Questions about the order of method calls
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!
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 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.
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.