Envelope rework#51
Merged
matburt merged 9 commits intoproject-receptor:masterfrom Nov 22, 2019
Merged
Conversation
02cbee1 to
ca5bbd9
Compare
FramedBuffer encapsulates handling of the new message format. Essentially there are 1 or 2 frames that constitute a message. [Header Frame][Header Body][Payload Frame][Payload] or [Command Frame][Command Body] Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
1. too much data 2. not enough data For project-receptor#1 we make sure we read no more than `to_read` in any given consume operation. For project-receptor#2 we make sure we have enough bytes on hand to unpack into a Frame, buffering if we don't. Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
3552471 to
7410565
Compare
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
matburt
approved these changes
Nov 22, 2019
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
47bdb2f to
3e52ec7
Compare
matburt
approved these changes
Nov 22, 2019
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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 decouples the routing information from the payload to allow for handling large payloads.
The general idea is to break the outer and inner envelope idea into two sequential parts, a header and a payload. Each section is preceded with Frame data that contains the message id and frame offset, as well as the length of the data to follow.
Currently, the Header contains the sender, recipient, and list of nodes already traveled. The idea is to read this into memory every time so that if the message needs to be routed we can do so without loading the entire payload into memory.
The payload is entirely arbitrary, but in practice will be encrypted data, and enough metadata to verify that the payload was actually destined for the node claimed by the header.