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 procedures When |
Beta Was this translation helpful? Give feedback.
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)
|
Beta Was this translation helpful? Give feedback.
1 reply
-
@Arkatufus would the new |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm coding a console application which process data from
stdin
with actors: I have amanager
actor andworkers
spawned and coordinated by themanager
.Here is a snippet from my
Main()
method:My question is how do I wait in the
Main()
method tillmanager
actor is done with it's job?And what is the proper way for the
manager
actor to signal theMain()
method about the fact that the processing is done and the program can terminate?Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions