Skip to content

Comments

Add timeouts for transport layer#10

Open
mwortmanp wants to merge 2 commits intorenameMethodfrom
transportConfig
Open

Add timeouts for transport layer#10
mwortmanp wants to merge 2 commits intorenameMethodfrom
transportConfig

Conversation

@mwortmanp
Copy link

No description provided.

TLSClientConfig: tlsConfig,
}

// Example timeout configuration

Choose a reason for hiding this comment

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

This isn't a super helpful comment

Comment on lines +1365 to +1380
baseTransport.DialContext = (&net.Dialer{
Timeout: 3 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext
baseTransport.TLSHandshakeTimeout = 3 * time.Second
baseTransport.ResponseHeaderTimeout = 10 * time.Second

observingTransport := &ObservingTransport{
Base: &baseTransport,
// Wrap with response capturing if callback provided
OnResponseCapture: config.OnResponseCapture,
}

client := http.Client{
Transport: transport,
Transport: observingTransport,
Timeout: 30 * time.Second, // Overall request timeout

Choose a reason for hiding this comment

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

I think we will want a way to pass the timeout value in, since we have the concept of an RPC timeout. This should be super nice.

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