DOC: add tutorials showing external interaction with actors
From the mailing list (Michael Slinn):
There is only one Akka tutorial (akka-tutorial-first). The top-level actor
does not return any value to the enclosing program; instead, output is
merely printed.
This is not helpful. There are various use cases for passing results back,
and each has its own set of issues. Either this tutorial should be extended
to show how results can be passed back to the enclosing program, or other
tutorial(s) should be created that demonstrate how to do this.
Some use cases:
Run to conclusion, pass results back and stop
Pass intermediate results back and stop upon completion
Run, but before completion the user or some other event (such as timeout)
causes the processing to stop prematurely, so return results so far and stop
----------------
I think the ask/askStream patterns answer the technical part of the question, but they should then also be worked into tutorials as recurring app template.
There is only one Akka tutorial (akka-tutorial-first). The top-level actor
does not return any value to the enclosing program; instead, output is
merely printed.
This is not helpful. There are various use cases for passing results back,
and each has its own set of issues. Either this tutorial should be extended
to show how results can be passed back to the enclosing program, or other
tutorial(s) should be created that demonstrate how to do this.
Some use cases:
Run to conclusion, pass results back and stop
Pass intermediate results back and stop upon completion
Run, but before completion the user or some other event (such as timeout)
causes the processing to stop prematurely, so return results so far and stop
----------------
I think the ask/askStream patterns answer the technical part of the question, but they should then also be worked into tutorials as recurring app template.
Leave a comment
on 2012-01-31 08:37 *
By Patrik Nordwall
Regarding the use cases and what has been done:
> Run to conclusion, pass results back and stop
I changed pi example to use a listener instead of a latch. The listener gets notified of the final result and stops the system.
> Pass intermediate results back and stop upon completion
In the fault handling sample I used a listener that gets notifed of intermediate progress and when 100% it stops the system.
> Run, but before completion the user or some other event (such as timeout) causes the processing to stop prematurely, so return results so far and stop
In the fault handling sample I use receive timeout to detect that something is wrong with the worker task.
> Run to conclusion, pass results back and stop
I changed pi example to use a listener instead of a latch. The listener gets notified of the final result and stops the system.
> Pass intermediate results back and stop upon completion
In the fault handling sample I used a listener that gets notifed of intermediate progress and when 100% it stops the system.
> Run, but before completion the user or some other event (such as timeout) causes the processing to stop prematurely, so return results so far and stop
In the fault handling sample I use receive timeout to detect that something is wrong with the worker task.
on 2012-02-08 01:06 *
By Jonas Bonér
Summary changed from Docs: add tutorials showing external interaction with actors to DOC: add tutorials showing external interaction with actors
Tutorials should be removed anyway. See other ticket.