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

implement SetTimeout without touching http.Client.Timeout #545

Open
okhowang opened this issue Jun 7, 2022 · 3 comments
Open

implement SetTimeout without touching http.Client.Timeout #545

okhowang opened this issue Jun 7, 2022 · 3 comments

Comments

@okhowang
Copy link

okhowang commented Jun 7, 2022

currently SetTimeout just modify http.Client.Timeout

func (c *Client) SetTimeout(timeout time.Duration) *Client {
	c.httpClient.Timeout = timeout
	return c
}

when we create resty.Client with NewWithClient. it do side effect if we use http.Client in other code.
maybe we should keep timeout in resty.Client, and do context.WithTimeout before every request?

@yunduan16
Copy link

+1

@aadog
Copy link

aadog commented Aug 24, 2022

#574

@aadog
Copy link

aadog commented Aug 24, 2022

I implemented session pattern, you can use

@jeevatkm jeevatkm added this to the v3.0.0 Milestone milestone Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants