-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to maintain order of messages #6
Comments
You’ll need to provide a self contained code snippet demonstrating the issue, otherwise it is impossible to guess what you are soing wrong |
CodeSample.zip |
@RonStein2000 can you minimize the issue further? There's still too much code in there to dig through for me to be able to help |
I am sorry. Now here comes my next try (see attachment). I do not think I can minimize it further. You will need scala test to execute the test. I have used scala 2.12.11. If the delay (as in the code) is set to 0, the test will fail. If you set it to 20 millis, it will pass. The question is why? My assumption would be, that the end elements are processed last (in order) by each actor. |
I created a pool actor (basic actor) which internally uses another N basic working actors which do the processing round-robin. After all items to process were sent to the pool, I sent an "end-of-work" marker for each working actor with the assumption that they are handled last (after the last item sent) by the actor. When the end marker was received, the actor would countdown a latch and I can then wait for the pool to be finished with all items when the latch is done for all actors. This did not work as expected - only if I add a delay after the item sending phase (~ 100ms) the "end-of-work" markers are in order. Without the delay, the end-markers got handled before some items and that of course crashed the semantics. Is this intended? What am I missing here?
The text was updated successfully, but these errors were encountered: