Replies: 3 comments 1 reply
|
I decided to use a var allWorkDone = new Barrier(2);
var actorSystem = ActorSystem.Create("mysys");
var manager = actorSystem.ActorOf(Props.Create<Manager>(allWorkDone), "manager");
var line = Console.In.ReadLine();
while(line != null) {
manager.Tell(new ProcessLine(line));
var line = Console.In.ReadLine();
}
allWorkDone.SignalAndWait(); // wait till the `manager` actor calls allWorkDone.SignalAndWait() too
// termination proceduresWhen |
0 replies
|
You can use Ask instead of Tell to wait for a response (of crs your manager actor shall then send a reply back when the process is finished) |
1 reply
|
@Arkatufus would the new |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm coding a console application which process data from
stdinwith actors: I have amanageractor andworkersspawned and coordinated by themanager.Here is a snippet from my
Main()method:My question is how do I wait in the
Main()method tillmanageractor is done with it's job?And what is the proper way for the
manageractor to signal theMain()method about the fact that the processing is done and the program can terminate?Thank you in advance!
All reactions