I think you misunderstood what cluster events are for.

MemberUp/Down aren't fired when your actors come up, they're fired when a 
new member joins the cluster.  If you want an actor to know when another 
actor is ready, you need to explicitly send a message.  You can however use 
DeathWatch to know if an actor dies.

On Friday, May 9, 2014 6:14:24 PM UTC-6, Eugene Dzhurinsky wrote:
>
> Roland, many thanks for the reply!
>
> As far as I understood, the proposed (and desired) way to partition a task 
> across a cluster is to let the *worker* actors to *pull* a chunk of a 
> task from a *task actor* instead of having the task actor to *push* the 
> chunk of data to the *workers*.
>
> This sounds promising, I'm thinking about the following setup:
>
> - maintain pre-started set of worker actors *B *in the cluster.
> - on a new task request, start a new actor *A* in the cluster, which will 
> hold the task details and could be able to split the task into chunks.
> - all actors *B* will get a *MemberUp* event with this new actor A 
> available
> - all actors of *B* will maintain their own internal list of references 
> to actors of type 
> *A*- whenever an actor B is in *Await* state or moves into *Await* state, 
> it inspects it's own list of actors *A*, chooses one of the actors and 
> *ask* the actor about the next chunk of data to process.
> - once the chunk is processed, the actor *B* sends results to the actor 
> it got the data from, and takes next actor *A* from it's list, if any (if 
> it reaches the end of the list - then it starts over).
> - if an actor *A* received the last chunk of data, it terminates
> - all actors f type B receive the message *MemberDown* from actor *A* - 
> then it removes the actor reference from it's list.
>
> With this schema I could easily scale the set of worker actors *B* to new 
> nodes, which will join the cluster. In case if actor *B* goes down - then 
> I can handle such an event in *A* and move chunks from "*inprogress*" 
> list to "*pending*" list, so the next request to get a data chunk from 
> *B*will return this chunk for a new trial.
>
> The questions I've got so far:
>
> - how do I start an instance of actor A in the cluster on a randomly 
> chosen node? How do I do this from a *ClusterClient*?
> - is it a good idea to continuously *pull (ask)* for a next chunk with 
> some timeout set? Like, pull every 1 second? Or there's a better (more 
> actor-ish) way to do this?
> - is it enough to issue "*stop()*" in *FSM *to terminate an actor, so 
> *MemberDown* event will be generated in the cluster? Or actor needs to 
> send a *poison pill* to itself?
>
> Many thanks for the help!
>

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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