Added oneshot reply to outbound messaging #1703
Merged
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.
Description
Each message sent using outbound messaging now has a oneshot attached.
A success or failure result is guaranteed to be sent back on the oneshot
for every message sent.
Convenience functions were added to allow callers to easily know the
state of each message sent.
This was implemented with minimal breaking changes to the public
outbound messaging api.
result in the peer being marked as offline.
discovery to those within this node's region.
Motivation and Context
The only way to know that a message was actually sent or not was to listen on the messaging event stream and sift through until you find your message tags. This change provides a way to know if a message was sent or not with a MessageSendStates struct returned from the send call. To limit breaking changes, the api may not be as ergonomic as it could be. This is a TODO.
How Has This Been Tested?
Unit tested MessageSendStates and updated some existing tests that test the messaging protocol.
Types of changes
Checklist:
development
branch.cargo-fmt --all
before pushing.