-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put the client connection behind a protocol (#727)
Motivation: Generated client stubs may only be initialized using a `ClientConnection` which makes the assumption that a connection will only ever be singular, and that all RPCs for that stub will run on a single event loop. However, there are scenarios where we may want to drive a stub and have multiple connections (load balancing), or no real connection at all (testing). Modifications: - Generated client stubs now depend on the implementation of a `GRPCChannel` - The first argument label for the `init` in generated clients has changed from `connection` to `client` - Added fixits for the above - Updated generated code - `GRPCChannel`s contract ensures that RPCs can be made but do not specify the transport. - `GRPCClient` now requires a `GRPCChannel` - `GRPCClient` provides higher level wrappers for the factory methods on `GRPCChannel` (i.e. provide defaults such as for call options) Result: - We have a better ability, in the future, to use already-generated stubs with different `GRPCChannel`s. - Cleaner abstraction between call and connection.
- Loading branch information
Showing
42 changed files
with
580 additions
and
322 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
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
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
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
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.