Skip to content

Differentiate between timeout=None and timeout=UNSET. - #592

Merged
lovelydinosaur merged 4 commits into
masterfrom
timeout-none-is-respected
Dec 4, 2019
Merged

Differentiate between timeout=None and timeout=UNSET.#592
lovelydinosaur merged 4 commits into
masterfrom
timeout-none-is-respected

Conversation

@lovelydinosaur

Copy link
Copy Markdown
Contributor

Builds on #591. Closes #433.

@lovelydinosaur

Copy link
Copy Markdown
ContributorAuthor

Behaviour now is...

url="https://httpbin.org/delay/10"# Default behavior, timeouts after 5 seconds.awaithttpx.get(url)
# Default behavior, timeouts after 5 seconds.client=httpx.Client()
awaitclient.get(url)
# Override timeout on client, does not timeout, returns response after 10sclient=httpx.Client(timeout=None)
awaitclient.get(url)
# Override timeout on method, does not timeout, returns response after 10sclient=httpx.Client()
awaitclient.get(url, timeout=None)
# Override timeout on method, does not timeout, returns response after 10sclient=httpx.Client(timeout=5)
awaitclient.get(url, timeout=None)

@lovelydinosaur
lovelydinosaur merged commit eb7c6b0 into masterDec 4, 2019
@lovelydinosaur
lovelydinosaur deleted the timeout-none-is-respected branch December 4, 2019 11:54
@lovelydinosaurlovelydinosaur mentioned this pull request Dec 4, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Passing 'timeout=None' should always result in no timeout

1 participant

@lovelydinosaur