Skip to content
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

Support get N or all messages from channel in one command #301

Open
longquanzheng opened this issue Jul 6, 2023 · 2 comments
Open

Support get N or all messages from channel in one command #301

longquanzheng opened this issue Jul 6, 2023 · 2 comments

Comments

@longquanzheng
Copy link
Contributor

longquanzheng commented Jul 6, 2023

  • OneToAll
  • ZeroToAll
  • N (constant number)

this will be good for optimization.

Today for receiving N messages in a command is already working, but in a non-ideal way. Because workflow will have to repeat the command N times in a commandRequest. In the implementation, it will wait for each command separately. If N=2, then this mean that the state could consume 1 message, and then waiting for another one.

Partially consume and wait could cause potential "deadlock" situation. Ideally, it should wait and consume N messages atomically -- if they are all ready then consume, otherwise do not consume.

@longquanzheng
Copy link
Contributor Author

Make sure to call drain signals before waiting

@longquanzheng
Copy link
Contributor Author

duplicate of #280

@longquanzheng longquanzheng changed the title Support get all messages from channel in one command Support get N or all messages from channel in one command Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant