-
Notifications
You must be signed in to change notification settings - Fork 6
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
Base branch for protocol v2 #127
Conversation
cc48498
to
23a05c8
Compare
d310cd0
to
4311f54
Compare
973954f
to
fd4afee
Compare
* Update PROTOCOL.md * Update PROTOCOL.md Co-authored-by: Jacky Zhao <[email protected]> * Update PROTOCOL.md * half-close semantics * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * fmt * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Update PROTOCOL.md * Include reader-writer semantics --------- Co-authored-by: Jacky Zhao <[email protected]>
* ReadStream implementation * remove tee for now * Make the stream itself an iterable * Implement return for iterator * comment
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.
talked more IRL, going to think a bit more about the stream interface and ergonomics broadly
i think directionally very correct but could use a lot of simplification
README.md
Outdated
input: Type.Object({ n: Type.Number() }), | ||
output: Type.Object({ result: Type.Number() }), | ||
requestData: Type.Object({ n: Type.Number() }), | ||
responseData: Type.Object({ result: Type.Number() }), | ||
errors: Type.Never(), | ||
// note that a handler is unique per user RPC | ||
async handler(ctx, { n }) { |
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.
probably needs an update too
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.
same with await client.example.add.rpc
below
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.
docs
good review, i'll be sending some PRs and we can sync up afterwards |
Got some comments on streams being complicated, so this is a take on simplified API. - Less methods and states that people need to understand - Merge interfaces into a single object (i.e. a `stream` call would have both read and write capabilities on the same object)
## Why Follow up on #249 to actually use the new interfaces. Removed extra refactor done in #249 that merges the interfaces as that proved to be a challenging API (un-yak-shave 🙅 🐃) ## What changed - Removed close requests (mostly cherry-picked from #248) - Otherwise a simple swapping out of the interfaces ## Versioning - [ ] Breaking protocol change - [ ] Breaking ts/js API change <!-- Kind reminder to add tests and updated documentation if needed -->
Just a simple follow up to #250
Partially to match gRPC nomeclature and to avoid confusion with AbortSignal/AbortController
its time. |
a couple of things left that we'll fix against main |
All the changes are documented in
Protocol.md
but here's a summary:Pushable
andAsyncIterator
APIs to aReadStream
andWriteStream
init
and some haveinput
While the changes are not strictly backwards compatible, hence the major protocol bump, the system can still operate across versions to some extent.
See PRs linked below for more information on the above
TODOs
Define protocol and update doc [protocol v2] RFC PROTOCOL V2 #111
Design stream abstractions [protocol v2] RFC: custom streams #118
Implement stream abstractions
All streams have init, some have input.
Use stream abstractions & implement protocol closing semantics
Input
iterator on the server useResult
so we can signal stream closes, client disconnects, and aborts [protocolv2] Make ReadStream always emit Result values #172Add Abort mechanism
INVALID_REQUEST
to schema Add INVALID_REQUEST to RiverUncaughtSchema #107INVALID_REQUEST
errors with an abort bit [protocolv2] Handle invalid requests and internal server errors #203INTERNAL_RIVER_ERROR
with an abort bit [protocolv2] Handle invalid requests and internal server errors #203UNCAUGHT_ERROR
[protocolv2] Treat uncaught handler errors as abort #201Try to find uncovered areas to test
undefined
value forinit
,input
, &output
.Update docs
Changelog