-
Notifications
You must be signed in to change notification settings - Fork 103
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
WIP: Have http and tchannel transports optionally take in a net.Listener #897
Conversation
@peter-edge, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kriskowal to be a potential reviewer. |
Putting a hold on this - I'm having some issues with TChannel when I pass in a listener to the Channel instead of an address, I've been playing with it for way too long locally. |
@peter-edge I think adding ListenerChannel as an option would be a fine solution. Note that only tchannel.ChannelTransport uses the WithChannel option. You have more control over the underlying channel for tchannel.Transport. You can use a private interface or even bind directly to the tchannel Channel internally, since that channel is not exposed to or provided by the user. |
Can you give an example? Not sure I completely understand :)
…On Tue, Apr 11, 2017 at 2:08 AM Kris Kowal ***@***.***> wrote:
@peter-edge <https://github.com/peter-edge> I think adding
ListenerChannel as an option would be a fine solution.
Note that only tchannel.ChannelTransport uses the WithChannel option. You
have more control over the underlying channel for tchannel.Transport.
You can use a private interface or even bind directly to the tchannel
Channel internally, since that channel is not exposed to or provided by the
user.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AECGvKRtuJwpC1O9eoeKq25eoVBAsTB4ks5rusRfgaJpZM4M3YtY>
.
|
There are currently two TChannel transport implementations, but they share the same options and config type for the sake of using the same package and names.
Consequently, although you can provide a WithChannel and ServiceName option to both NewTransport and NewChannelTransport, only the latter uses them. What this implies for this change: In this change you’re breaking backward compatibility by adding a Serve method to the Channel interface. We use that interface in two different ways. One is as an option for NewChannelTransport. The other is for a private property of Transport. You could introduce a private listenChannel interface that would not interfere with the old ChannelTransport options. |
Closing this for now, may revisit at another time |
This is just a concept, feel free to reject. This is re: #866, I would also add this to grpc if we thought this was the way to go.
Note this is technically a breaking change because
Serve(net.Listener) error
is added totchannel.Channel
. I don't know if this is OK, but if not, I can make aChannelExtended
interface or such that includes this method, and we can change this in 2.0.