How to send notifications from grain to client preserving order? #9679
Replies: 1 comment
-
|
That appeared to be my fault because I was not awaiting delegate executed on timer and timer was creating multiple threads calling grains in a random order. |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Assume, there is a grain that every microsecond compares time series from several sources, e.g. files, and sends notification with the next smallest value to its subscribers.
Example
File A: 1, 3, 10
File B: 2, 20
Expected behavior
Combining time series and picking next smallest value from two sources works fine within the grain but when notification is sent outside, the order gets lost. Tried to use Orleans streams and IGrainObserver but their async nature and probably back pressure shuffles notifications so client receives them in random order.
Pseudo-code
Actual implementation
https://github.com/Indemos/Terminal/blob/orleans/Gateways/Simulation/Libs/Grains/ConnectionGrain.cs
Question: If the sequence inside the grain is 1, 2, 3, 10, 20, how to ensure that it stays the same when these numbers are sent one by one outside the grain?
Beta Was this translation helpful? Give feedback.
All reactions