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

HTTP transport constructors refactor #540

Merged
merged 1 commit into from
Dec 7, 2016
Merged

Conversation

kriskowal
Copy link
Contributor

These changes, based on #529, pivot the HTTP transport away from using New* functions on the "transport/http" package to using http.NewTransport() and transport.New* methods for all construction needs. This includes the introduction of transport.NewSingleOutbound, which restores simplicity to the simple case. In all of these cases, the tracer gets threaded from the transport’s configuration into the creation of all dependent inbounds and outbounds. NewSingleOutbound benefits from being able to thread the transport into the single peer chooser behind the scenes.

@mention-bot
Copy link

@kriskowal, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bombela, @abhinav and @AlexAPB to be potential reviewers.

@kriskowal kriskowal force-pushed the http-transport-refactor branch 2 times, most recently from f37a7f3 to 170e5ec Compare December 7, 2016 04:29
kriskowal added a commit that referenced this pull request Dec 7, 2016
kriskowal added a commit that referenced this pull request Dec 7, 2016
@kriskowal kriskowal mentioned this pull request Dec 7, 2016
@@ -26,12 +26,15 @@ import (
"sync"
"time"

"github.com/opentracing/opentracing-go"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import order

Copy link
Contributor

@HelloGrayson HelloGrayson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be my favorite PR of all time.

@@ -123,19 +121,17 @@ func runTChannelClient(b *testing.B, c *tchannel.Channel, hostPort string) {
}

func Benchmark_HTTP_YARPCToYARPC(b *testing.B) {
httpTransport := yhttp.NewTransport()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great!

Unary: yhttp.NewOutbound(
single.New(hostport.PeerIdentifier("http://localhost:8999"), httpTransport),
),
Unary: httpTransport.NewSingleOutbound("http://localhost:8999"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy hell this is so much cleaner.

@kriskowal kriskowal merged commit 2f5336e into dev Dec 7, 2016
@abhinav abhinav deleted the http-transport-refactor branch March 27, 2017 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants