Currently the SyncContext and SyncArbiter kind of live in their own world and are not well integrated in the whole ecosystem. Let addr = SyncArbiter::start( 10, || Redis::new( "redis://redis").unwrap()) Ī lot of libraries are sync (diesel is the one we use) and likely won't change anytime soon. My preferred solution would be to add a set method on the SystemRegistry like:.The main disadvantage is you now need to await the send call to first get the address of the sync actor and then await again to send a message to it. It is quite elegant but the gist is old and not working anymore. One possible solution is to have an actor to keep track of them (suggested on stackoverflow).This is annoying if you rely mostly on the registry but have a few sync actors for database calls for exemple. Thus you need another system to keep track of the sync actors and their addresses. Current BehaviorĬurrently the SystemRegistry can only have actors with a Context. Being able to do MySyncActor::from_registry() and have it work like async actors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |