orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Questions about the order of method calls

Open w14525555 opened this issue 8 years ago • 3 comments

Hi,

I am working on a stream processing system which might be sensitive to the orders of the method calls between grains. If I call an async method which sends messages from A to B multiple times, will the messages are processed in order?

Thanks!

w14525555 avatar Aug 08 '18 17:08 w14525555

If you do not await each message prior to sending the next, the messages can arrive out of order, especially under error conditions.

If you can't afford to await each message, due to performance reasons, I'd suggest batching all of the request into a single grain call, queuing up new messages while that grain call is pending, and then sending the next batch once the call returns.

jason-bragg avatar Aug 08 '18 18:08 jason-bragg

@jason-bragg Thanks for your answer! You are right. We cannot use await due to performance issues. Is the solution that you mentioned the only way to solve this problem? It seems it still needs use await to wait a batch.

w14525555 avatar Aug 08 '18 18:08 w14525555

Thanks for contacting us. We believe that the question you've raised has been answered. If you still feel a need to continue the discussion, feel free to reopen the issue and add your comments.

ghost avatar Nov 18 '21 05:11 ghost