-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactor req-rep operators to use only ZMQ types #7
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The last few commits refactor the basic req-rep operators to use a |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the req-rep operators to use only built-in types in ZeroMQ (
byte[]
,string
andNetMQMessage
). This will allow removing the dependency from the OSC package and keep ZMQ support more agnostic to different serialization protocols.Other feature highlights:
Request
blocks waiting for the response from the server but can now be asynchronously cancelled.Response
can now operate in one of two modes:ResponseContext
which can be evaluated asynchronously using the newSendResponse
operator. This provides the basis for flexibly evaluating responses in full asynchronous fashion while still keeping to the strict sequential nature of the req-rep pattern.Dealer
now operates as fully asynchronously in distributing messages and routing back responses. The empty frame delimiter is prefixed by default to emulate the req-rep pattern.Router
can now also operate in source or combinator mode like theResponse
operator:Response
operator where multiple requests may be evaluated simultaneously and responses are correctly paired to clients by using message identities.Utility operators:
ToMessage
constructs a multiple part message from a sequence of frames or data objects.ConvertToFrame
constructs a single frame for each data object in the sequence.ConvertToString
decodes a message frame into a string.GetIdentity
extracts all identity frames from a multiple part message, up to and including the empty frame delimiter.