I'm just starting to work with Akka and I can't decide if I should use dependency injection (like cake pattern) or actor lookup in order to decouple the actors from each others. What is the preferred method?
You should prefer to introduce actors to each other, which means to send an ActorRef in or with a message or to pass it into a constructor. The latter may involve the cake pattern of you so choose, but lookup is much more expensive and therefore you should use real ActorRef whenever possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With