-
Notifications
You must be signed in to change notification settings - Fork 419
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
Pull channel creation out of ConnectionManager
#1158
Merged
Merged
Conversation
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
Motivation: The `ConnectionManager` is initialized with a `ClientConnection.Configuration` struct because it needs enough "stuff" to make `NIO.Channel`s with. That's not really information it needs to hold on to, it just needs a way to make channels. Moreover, it limits the connection manager to using only that configuration object. That's a bit of a pain if we want to add a connection pool with a different configuration object. Modifications: - Pull out the channel creation into a `ConnectionManagerChannelProvider` protocol. - Move the `ClientConnection.Configuration` based channel creation into an object conforming to the above. Result: Looser coupling.
Lukasa
approved these changes
Apr 7, 2021
glbrntt
added a commit
to glbrntt/grpc-swift
that referenced
this pull request
Apr 14, 2021
Motivation: In grpc#1158 we pulled connection creation of the connection manager into a channel provider in order to loosen the coupling between the connection manager and `ClientConnection`. This change further decouples the `ConnectionManager` from the channel provider pulling out the relevant configuration into a `DefaultChannelProvider`. Modifications: - Refactor `ClientConnection.ChannelProvider` to rely on the bits of configuration it actually requires rather than `ClientConnection.Configuration` - Rename to `DefaultChannelProvider` Result: We can configure channels for the `ConnectionManager` without being tied to `ClientConnection`.
glbrntt
added a commit
to glbrntt/grpc-swift
that referenced
this pull request
Apr 14, 2021
Motivation: In grpc#1158 we pulled connection creation of the connection manager into a channel provider in order to loosen the coupling between the connection manager and `ClientConnection`. This change further decouples the `ConnectionManager` from the channel provider pulling out the relevant configuration into a `DefaultChannelProvider`. Modifications: - Refactor `ClientConnection.ChannelProvider` to rely on the bits of configuration it actually requires rather than `ClientConnection.Configuration` - Rename to `DefaultChannelProvider` Result: We can configure channels for the `ConnectionManager` without being tied to `ClientConnection`.
glbrntt
added a commit
to glbrntt/grpc-swift
that referenced
this pull request
Apr 14, 2021
Motivation: In grpc#1158 we pulled connection creation of the connection manager into a channel provider in order to loosen the coupling between the connection manager and `ClientConnection`. This change further decouples the `ConnectionManager` from the channel provider pulling out the relevant configuration into a `DefaultChannelProvider`. Modifications: - Refactor `ClientConnection.ChannelProvider` to rely on the bits of configuration it actually requires rather than `ClientConnection.Configuration` - Rename to `DefaultChannelProvider` Result: We can configure channels for the `ConnectionManager` without being tied to `ClientConnection`.
glbrntt
added a commit
that referenced
this pull request
Apr 14, 2021
Motivation: In #1158 we pulled connection creation of the connection manager into a channel provider in order to loosen the coupling between the connection manager and `ClientConnection`. This change further decouples the `ConnectionManager` from the channel provider pulling out the relevant configuration into a `DefaultChannelProvider`. Modifications: - Refactor `ClientConnection.ChannelProvider` to rely on the bits of configuration it actually requires rather than `ClientConnection.Configuration` - Rename to `DefaultChannelProvider` Result: We can configure channels for the `ConnectionManager` without being tied to `ClientConnection`.
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.
Motivation:
The
ConnectionManager
is initialized with aClientConnection.Configuration
struct because it needs enough "stuff"to make
NIO.Channel
s with. That's not really information it needs tohold on to, it just needs a way to make channels. Moreover, it limits
the connection manager to using only that configuration object. That's a
bit of a pain if we want to add a connection pool with a different
configuration object.
Modifications:
ConnectionManagerChannelProvider
protocol.
ClientConnection.Configuration
based channel creation intoan object conforming to the above.
Result:
Looser coupling.