-
Notifications
You must be signed in to change notification settings - Fork 143
Protocol 0.2.0 #86
base: master
Are you sure you want to change the base?
Protocol 0.2.0 #86
Conversation
Ping @mcollina for review of initial draft Matteo, I am still uncertain about the method for doing acks, you were as well. Think of possibly keeping acks much simpler, a simple integer message, 0 for non-error ack, and > 0 for error ack. When an error is received a string message can follow, then a remote close. If no string message is given then the close should still happen resulting in an EOF. The simple integer type will work well with msgpack and cbor as most messages will only end up being a single byte. |
A `channel` is an object which allows 2 concurrent programs to communicate with | ||
each other. The semantics of a libchan channel are very similar (but not | ||
identical) to those of Go's native channels. A channel may be used | ||
synchronously, but do not support Go's channel select semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add:
"For those not familiar with Go, this means it does not support any synchronization primitives".
Sorry for not reading this through sooner, I was stuck in the consulting businness :(. I think we should add a header for the message encoding. This is necessary to ensure things works with different encodings. I propose to add a mime type of Should I send a PR against this PR with my updates? Thanks for adding me as an author 👯. |
Excellent point, any newly created stream which will send data should have a content-type. Types
|
6349048
to
403a80b
Compare
Updated based on original feedback, still need to update for content types |
👍 for the types. Just one question: what happens if the other party does not support that encoding? |
I think the ":status" as used currently in spdy and defined in HTTP is missing here. I will add ":status" as the response header which should contain an HTTP status code. In the case of unsupported content-type, a 415 would be used. |
Hmm looking more at the streams interface, I am thinking streams will need to have a function to handle the reply unless it would be expected the stream provider would be configured to know how to accept content-types and expose that to the stream user. My goal would be after a new stream is accepted, it is always good and would never need to explicitly failed by the stream user because of invalid content-type. |
Update to the protocol as a result of libchan meeting with Matteo Collina. Bump the version to 0.2.0 and name the set the previous version as 0.1.0. Protocol changes: - Define stream provider to support multiple multiplexing protocols - Support CBOR in addition to Msgpack for channel message encoding - Add extended type codes definition - Require byte-streams to send *"libchan-parent-ref"* - Allow byte-streams as duplex or half-duplex - Add channel synchronization through ack definition - Add channel errors - Update description of relationship to Go channels - Add stream content type Other changes: - Add Derek and Matteo to authors - Reformatted to 80 character lines - Much cleanup and rewording Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
403a80b
to
bef951f
Compare
Finally pushed the update. Going to revive this and get this work completed. |
Updated with last comments and content types Pushed an update to the streams library in support of this change dmcgowan/streams@f02a9e7. This will enable proper content type handling by libchan. |
Update to the protocol as a result of libchan meeting with Matteo Collina.
Bump the version to 0.2.0 and name the set the previous version as 0.1.0.
Protocol changes:
Other changes: