How to wait for the completion of all work in Akka.Net?

I successfully sent the work to the pool of actors to do my job, but now I want to do some set of results obtained by all employees. How do I know that everything is done?

The best thing I've come up with is to maintain a set of request identifiers and wait for this set to be zero, but that seems inelegant.

+7
source share
1 answer

Typically, you want to use what we call the "Commander" template for this. In fact, you have one subject with state ( Commander ), which is responsible for launching and monitoring the task. Then you process the actual work through the pool of actors and return them to Commander as they are completed. The commander can then track the progress of the task, calculating # completions / size of worker pool .

Thus, employees can be monitored and restarted independently, as they perform this work, but all the valuable states and information at the task level live in the Commander (this is called the "Error kernel model" )

You can see an example of this in the demo of Akka.NET's scalable web browser .

+8
source share

All Articles