Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka actor lookup or dependency injection

Tags:

akka

actor

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?

like image 830
Cristian Vrabie Avatar asked Jul 21 '13 09:07

Cristian Vrabie


1 Answers

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.

like image 56
Roland Kuhn Avatar answered Nov 08 '22 20:11

Roland Kuhn