heimdall
heimdall copied to clipboard
Support single connection for multiple request
Is this library support using single connection for multiple request? So it doesn't need handshake process for every request
you can use custom client:
type client struct {
client *http.Client
transport http.RoundTripper
}
func (client *client) Do(request *http.Request) (*http.Response, error) {
request.Close = false //This will be prevent closing of tcp connection, heimdall sets this attribute on true
return client.client.Do(request) \
}
hystrix.NewClient(
hystrix.WithHTTPTimeout(30*time.Second),
hystrix.WithHTTPClient(NewClient())
)
@lukas016 do u know why we close tcp connection after every request instead of reusing it?
@komalasurya sorry, but i don't use or follow this project anymore. So if my comment above do problem you/i can deleted it. In my use cases i don't need close each connection to server, but heimdall wasn't very well for my use cases and comment above is from one of tests, when it works for me.