Hi,
I've read the Akka docs, played around with spray, read a billion blogs,
read a couple books but all the examples have very simple actor networks.
I'm wondering what the recommended practices is for a few scenarios (I'd
prefer not to use Spring, but some these feel DI-ish).

----

Spray actor-per-request (it's not important that it's spray)

A unit of work arrives in one actor and you want to create an actor to do
the actual work while the first actor waits for more work to arrive. The
worker's identity is not important and it only lives until the work is
done.

Do people just build the actor directly? Seems bad because you can't test
the actor gathering the work and the worker separately. Passing a worker
factory function when the gatherer actor is created? Seems like it gets
unwieldy when there are several services, repositories and the like around.
Providing a worker factory stackable traits?

----

Application with several services and repositories

A dozen or so different components, each of which is an actor. Should each
component get created when the app is initializing, each component getting
its dependencies passed in via the constructor? or via an Initialize
message? Or should the stackable traits or cake pattern be used? (Most of
our team's experience is with Java so simpler and explicit is best).

What about a component registry or "context" object either passed
explicitly to each component or globally accessible?

Or give the actor components names and have components select their
dependencies by name at creation or initialization time?

----

Tens of thousands of actors holding state

Think of a chat app where each conversation which lasts for an hour or two
is modeled with an actor.

Is it reasonable to name each state-holding actor after it's conversation
id? The web-service would then pull the id out of the URL and use it actor
selection to find the state-holding actor. Or is it better to have another
registry actor that manages the mapping from conversation id to actor ref?
Does the answer change if we do clustering and some of the state-holding
actors are on remote machines?

And same questions about initializing the actor who creates the
state-holding actors which themselves might be created on the fly: http
handler actor needs to create a per-request actor which in turn needs to
create the state-holding actor. Its easy enough do this by writing little
factory functions that include nested factory functions that can passed
down as actor constructor or initialize arguments, is this common practice
or is there better way?

----

And a couple of closing questions:

Do routers help any of this?

Are there libraries or components somewhere that abstract common actor
orchestration patterns?

And of course if I failed to find something out there or am missing the
point somehow, please send links.

Thanks!
Sandy

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to