pusher / pusher-http-python

Pusher Channels HTTP API library for Python
https://pusher.com/docs/server_api_guide
MIT License
375 stars 112 forks source link

Timeout type forced to be integer #194

Closed ysaunier closed 1 year ago

ysaunier commented 1 year ago

Hi team! 👋

Just a quick question: Why did you set a validation that the timeout type must be an integer? (cf. your validation). According to the requests documentation, the accepted type is a float. (cf. the documentation).

This is painful because we are forced to set seconds with your timeout when we would like to define milliseconds.

edmundlam commented 1 year ago

I wonder if we could also allow a tuple of numbers as well, since requests also allows it.

For example, a timeout=(5, 27) will set a connection timeout of 5 seconds, and a read timeout of 27 seconds. If you are open to this change, I'd be happy to adjust my PR to account for tuples.

Ref: https://requests.readthedocs.io/en/latest/user/advanced/#timeouts

benjamin-tang-pusher commented 1 year ago

Thanks @edmundlam, I will give it a test and approve it.

benjamin-tang-pusher commented 1 year ago

195 released in 3.3.1