-
Notifications
You must be signed in to change notification settings - Fork 94
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
zmq: implement REQ-REP + PUB-SUB comms #3329
Comments
Relevant for #2798. |
PUB/SUB has been merged as part of the WSchd <=> UIS data store sync PR .. So available as an option for mutation feedback |
See the older #423 which proposes much the same thing. |
See #4274 (which aims to coordinate these two patterns) |
Does that close this? |
Yes, it does. |
Oh, they weren't, you just edited the description to add the link 👍 |
* Separate scheduler commands from the main scheudler code. * Integrate command validators in with the commands themselves. * Make all commands async and provide a blank validator for each (i.e. add a yield at the top of each function). * Partially addresses cylc#3329 by making commands generators capible of returning multiple messages.
* Separate scheduler commands from the main scheudler code. * Put all commands behind a decorator to protect against leakage. (e.g. an import cannot be mistaken for a command/validator). * Integrate command validators in with the commands themselves. This removes the duplicate command/validate function signatures and makes validators implicit (i.e. they are called as part of the command not searched for and called separately to the command). * Make all commands async and provide a blank validator for each (i.e. add a yield at the top of each function). Note this means that command args/kwargs are now validated as part of queueing the command itself by default. * Partially addresses cylc#3329 by making commands generators capible of returning multiple messages.
* Separate scheduler commands from the main scheudler code. * Put all commands behind a decorator to protect against leakage. (e.g. an import cannot be mistaken for a command/validator). * Integrate command validators in with the commands themselves. This removes the duplicate command/validate function signatures and makes validators implicit (i.e. they are called as part of the command not searched for and called separately to the command). * Make all commands async and provide a blank validator for each (i.e. add a yield at the top of each function). Note this means that command args/kwargs are now validated as part of queueing the command itself by default. * Partially addresses cylc#3329 by making commands generators capible of returning multiple messages.
It may be possible to achieve this on a single socket using router-dealer or some fancy combination of req-rep and router-dealer (see https://zguide.zeromq.org/docs/chapter3/), but this will require investigation. Note that req-rep is synchronous (e.g. "kill" followed by "trigger" will be queued in that order), whereas router-dealer is asynchronous ("kill" followed by "trigger" could be queued in either order) so we may need to leverage both (because queue order is somewhat important to us, although we have never claimed to guarantee it). Adding a new socket is not desirable (port efficiency matters), ideally we would look to consolidate the pub-sub socket too (see also xpub-xsub). |
* Separate scheduler commands from the main scheduler code. * Put all commands behind a decorator to protect against leakage. (e.g. an import cannot be mistaken for a command/validator). * Integrate command validators in with the commands themselves. This removes the duplicate command/validate function signatures and makes validators implicit (i.e. they are called as part of the command not searched for and called separately to the command). * Make all commands async and provide a blank validator for each (i.e. add a yield at the top of each function). Note this means that command args/kwargs are now validated as part of queueing the command itself by default. * Partially addresses cylc#3329 by making commands generators capable of returning multiple messages.
* Separate scheduler commands from the main scheduler code. * Put all commands behind a decorator to protect against leakage. (e.g. an import cannot be mistaken for a command/validator). * Integrate command validators in with the commands themselves. This removes the duplicate command/validate function signatures and makes validators implicit (i.e. they are called as part of the command not searched for and called separately to the command). * Make all commands async and provide a blank validator for each (i.e. add a yield at the top of each function). Note this means that command args/kwargs are now validated as part of queueing the command itself by default. * Partially addresses cylc#3329 by making commands generators capable of returning multiple messages.
* Separate scheduler commands from the main scheduler code. * Put all commands behind a decorator to protect against leakage. (e.g. an import cannot be mistaken for a command/validator). * Integrate command validators in with the commands themselves. This removes the duplicate command/validate function signatures and makes validators implicit (i.e. they are called as part of the command not searched for and called separately to the command). * Make all commands async and provide a blank validator for each (i.e. add a yield at the top of each function). Note this means that command args/kwargs are now validated as part of queueing the command itself by default. * Partially addresses cylc#3329 by making commands generators capable of returning multiple messages. * Improve interface for multi-workflow commands: - Colour formatting for success/error cases. - One line per workflow (presuming single line output). - Exceptions in processing one workflow's response caught and logged rather than interrupting other workflow's output. - Commands exit 1 if any workflow returns an error response. * Add multi-workflow test for "cylc broadcast".
Issue migrated from #2978
At present the suite runtime API is REQ-REP.
This pattern works fine for information requests, but for mutations the client usually just receives an unhelpful "command queued" message. There is no mechanism to communicate command output to the user.
To solve this we could add a PUB-SUB pattern on-top of the REQ-REP whereby:
From the client side this might look like:
This pattern should be used for mutations (and not for information requests).
The text was updated successfully, but these errors were encountered: