I’m finally getting started with Akka Typed and I ran into this issue:
- My main/root actor needs to bootstrap the system from persistent state
- So from
Behaviors.setupI would like to perform some async call to initialize everything and use that to produce the final Behavior
But there is no async version of
Are there other ways of initializing a
Behavior from a
The only way I can see this work is to pipe the result of the future to self, wrapped in a message, and return a temporary
Behavior that only handles that specific message. And then that temporary
Behavior switches to the final full
Behavior by handling that message.
Is that the right pattern for initializing an actor from an async call?