Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap out Actix #109

Open
ryardley opened this issue Sep 23, 2024 · 3 comments
Open

Swap out Actix #109

ryardley opened this issue Sep 23, 2024 · 3 comments
Labels
Ciphernode Related to the ciphernode package

Comments

@ryardley
Copy link
Contributor

Unfortunately I discovered on their discord last night that Actix is going to be deprecated in a few months. The recommendation the Actix team have been suggesting is to follow the patterns within this excellent post on how to use tokio to create actors another possibility would be to use ractor I think there are tradeoffs for both approaches.

Actix itself was written before async or tokio was a thing in Rust and it has been playing catch up despite being eventually built with it. Since then Tokio actually provides some good async channel primitives we can use which Actix defined itself.

This opens up opportunities to fix some of the annoying things about Actix:

  • Lack of simple async compatibility
  • Lack of hierarchical supervision
  • Unified state persistence story for actors
  • We don't really need all the features of the Actix framework anyway.
  • Makes it easier to share our Actor model throughout our codebase
  • We can simply use the broadcast channel from tokio to setup the eventbus.

We would want to attempt to avoid using too much boilerplate in our adoption of the Actor model although it requires a fair amount of generic gymnastics to avoid matching over an actor's valid messages which means more refactoring but possibly also means in the case of adopting tokio based actors we can have more transparent and easier to follow code.

I believe this should occur after we have a working prototype connected to the evm

@ryardley ryardley added the Ciphernode Related to the ciphernode package label Sep 26, 2024
@ryardley
Copy link
Contributor Author

ryardley commented Sep 26, 2024

Had some progress on prototyping this have managed to merge Actix API with tokio actors. I just want to see if it is possible to implement async handlers and we may avoid refactoring to a more complex system.

@ryardley
Copy link
Contributor Author

ryardley commented Oct 1, 2024

Current progress:

https://github.com/ryardley/tactix

Only thing left to do is enable recipients and we might be able to easily migrate.

@ryardley ryardley changed the title Refactor Actix to a basic Tokio Channels based Actor model Swap out Actix Oct 1, 2024
@ryardley
Copy link
Contributor Author

Getting further with this https://docs.rs/tactix/latest/tactix/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ciphernode Related to the ciphernode package
Projects
None yet
Development

No branches or pull requests

1 participant