ActorSystemis the heart of a Riker application, starting several threads when it is created. Create only one instance of
so, if i create the
main(), how do i access it in a different part of the application?
main()there's no way to get an
ActorRefin some disparate part of my application, other than passing an actor or a system, or a reference to those, into that part of the application
System, which is helpful for interacting with actors through system messages and in some cases user-level messages.
Context, but you are free to pass
ActorSystem, etc if you have parts of an application that are not an actor themselves
Senderisn't part of the
ActorSystemi need to pass around a ref, just like with the database connection, and, in my naïvité, i thought i could avoid that, but knowing the actor's name
typedfunction but needs an
ExtendedCellas parameter, no idea where to get that, looks like an internal type
@olanod - did you ever find a way to run a future to completion from within an actor's
recv method? Just using
block_on results in the error
LocalPoolexecutor from within another executor: EnterError
and trying to use the
ctx.run() method complains about a lifetime issue as the future that I'm trying to execute is a method on an S3 bucket client from rusoto. Thanks!
tokio::runtime::Handle::current()and then pass this handle around to the actor system whenever an actor needed to be able to block on a future. Hope this helps others! I think this should be added to the docs, and if I get motivated I may submit a PR for this.