-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework handler and client internals into streams
This is a very large commit that reworks the internals of handlers and clients to operate on streams. Apart from a few changes to NewHandler and NewClient, the tests continue to pass as-is. Adding support for streaming RPCs should now be easy: we're just generating type-safe wrappers around the generic stream type. The surface area of the change is relatively small: we add a Stream interface, Func equivalents for client- and server-side streams, and two helper functions to pull Interceptors out of Options. There are some distinct rough edges left: * I haven't yet added interceptor support for streams. * The client type should probably be reduced to a single-shot call. Though we'll still expose clients from generated code, they're doing very little beyond holding options. * The client-side stream implementation is overly complex. * Hand-writing unary handlers is now a fair bit of work, so we should move the health-checking support into a subpackage so we can use generated code without import cycles. * Once we can generate bidi streaming handlers, we should consider moving reflection support into a separate package too. This begins to address #1.
- Loading branch information
1 parent
46cab7f
commit 27d4be4
Showing
17 changed files
with
1,198 additions
and
779 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.