Skip to content
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

Defined Transport for the client #1045

Merged
merged 2 commits into from
Jun 16, 2021
Merged

Conversation

dgrr
Copy link
Contributor

@dgrr dgrr commented Jun 13, 2021

Solves #972

@dgrr
Copy link
Contributor Author

dgrr commented Jun 13, 2021

Notice that this implementation only works with the HostClient

@erikdubbelboer
Copy link
Collaborator

What is the reason for not adding it to Client as well?

@dgrr
Copy link
Contributor Author

dgrr commented Jun 14, 2021

What is the reason for not adding it to Client as well?

I'll in the future, but using the HostClient.Transport, and also I need more time for that. Doing so now in the Client is a little bit problematic. The ideal scenario would be to have something like the Server's NextProtos in the Client. So, on every new connection the HostClient creates, we'll need to check the TLS ALPN fields and if there's any extension for that has been added to fasthttp through a 3rd party library, then put it as TransportFunc.

The main problem is that the Client doesn't own the connections but the HostClient does. And the HTTP/2 lib manages it's own connections, therefore we assume all the Transport implementations are going to manage their own connections. Because at the end, the Transport call should only be used to send requests and get a response back.

As said, I'll try to support Transport in Client, but I'll need more time.

@dgrr
Copy link
Contributor Author

dgrr commented Jun 15, 2021

@erikdubbelboer

@erikdubbelboer erikdubbelboer merged commit be13b50 into valyala:master Jun 16, 2021
@dgrr dgrr deleted the client/transport branch June 16, 2021 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants