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

Make timeout configurable for all HTTP calls #13

Open
eschizoid opened this issue Nov 25, 2018 · 2 comments
Open

Make timeout configurable for all HTTP calls #13

eschizoid opened this issue Nov 25, 2018 · 2 comments

Comments

@eschizoid
Copy link
Contributor

eschizoid commented Nov 25, 2018

Rather than hardcoding the timeout (3 seconds), seems like a good idea to make this parameter configurable depending on the client needs.

@eschizoid eschizoid changed the title Configurable timeout Make timeout configurable for all HTTP calls Nov 25, 2018
@jrudio
Copy link
Owner

jrudio commented Nov 25, 2018

You can change it by accessing Plex.HTTPClient.Timeout directly. Like so:

plexConn, _ := plex.New("abc", "123")

plexConn.HTTPClient.Timeout = time.Minute * 1

But yeah, what's the best way to change the parameters? Like just add an extra argument? plex.New("abc", "123", 1 * time.Minute)

@eschizoid
Copy link
Contributor Author

eschizoid commented Nov 25, 2018

@jrudio Not sure if it would be useful to just allow clients to configure the timeout. What you think about allowing clients to pass the whole http.Client reference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants