You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably more something to be added in an extension crate, but it would be cool to be able to define actors from closures:
let initial_state = 0u64;
xtra::actor::unbounded(initial_state).handle(|name:String,ctx:&mutContext| asyncmove{format!("Hello {name}")});
Not sure how nameable the actor type would be (some nested AndHandler<HandlerFn<String, String>, AndHandler<HandlerFn<u64, u64>>> stuff probably) so perhaps one would only be able to access such an actor through MessageChannels?
The text was updated successfully, but these errors were encountered:
Hmm, this could be interesting, but it would probably lead to explosive compile times 😅 The upshot is that it could be done in an extension crate, though.
Hmm, this could be interesting, but it would probably lead to explosive compile times sweat_smile The upshot is that it could be done in an extension crate, though.
This is probably more something to be added in an extension crate, but it would be cool to be able to define actors from closures:
Not sure how nameable the actor type would be (some nested
AndHandler<HandlerFn<String, String>, AndHandler<HandlerFn<u64, u64>>>
stuff probably) so perhaps one would only be able to access such an actor throughMessageChannel
s?The text was updated successfully, but these errors were encountered: