We need a whiteboard :D

Do you understand why the task itself I prefer to do it on preStart()? If 
it fails no problem, but it cannot fail at onReceive(...) in fact onReceive 
only spawn actors and wait for termination messages.
If preStart fails it will restart that actor but no subtask ever started, 
if you got to onReceive this job specific task is done and what he needs to 
do is to supervise its subtasks.

On Friday, February 5, 2016 at 4:18:50 PM UTC, Guido Medina wrote:
>
> The mechanism is a bit tricky. the trick is to use preStart() to do that 
> Job unit of work and the 1st message to process sub-task explained in 
> details:
>
>    - Supervisor loads Job A which has a definition like how many times 
>    should retry, how long to backoff, etc.
>    - Supervisor spawn actor A, if preStart has something to do it does it 
>    and then message itself with StartSubTasks.
>    - Actor A receives StartSubTasks messages, creates a counter = size of 
>    subtasks:
>    - For each sub-task spawn actor, when actor finishes sends message to 
>    parent saying done and decrement counter, when counter is zero poisonpill 
>    self.
>
> What I haven't figured out is how to write state of subtask and failure 
> for that for that pattern is a start, btw you don't need to stash, use 
> preStart for task and onReceive for sub-tasks.
>

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to