Skip to content

Allow default+override timeout style - #593

Merged
lovelydinosaur merged 7 commits into
masterfrom
allow-default-and-override-timeout-style
Dec 5, 2019
Merged

lovelydinosaur merged 7 commits into
masterfrom
allow-default-and-override-timeout-style

Conversation

@lovelydinosaur

@lovelydinosaur lovelydinosaur commented Dec 4, 2019 •

Copy link
Copy Markdown
Member

Allow eg. Timeout(5.0, pool_timeout=None)

Closes #435, Closes #578

@lovelydinosaur lovelydinosaur changed the title Allow default and override timeout style Allow default+override timeout style Dec 4, 2019

@florimondmanca florimondmanca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice :) I like the improved copy as well.

Comment thread docs/advanced.md Outdated
Comment thread docs/advanced.md Outdated
* The **read timeout** specifies the maximum duration to wait for a chunk of
data to be received (for example, a chunk of the response body). If HTTPX is
unable to receive data within this time frame, a `ReadTimeout` exception is raised.
The default behavior is to raise a `RequestException` after 5 seconds of

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn鈥檛 it a RequestTimeout?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks!

What do we actually want the base timeout exception to be called? TimeoutError is a python built-in, so I guess we've got...

  • TimeoutException
  • BaseTimeout
  • RequestTimeout

?...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like TimeoutException best: explicit, boring and unsurprising. (RequestTimeout has an odd vibe to it that I can't really explain, and BaseTimeout sounds like a base class.)

Comment thread docs/advanced.md Outdated
@lovelydinosaur

Copy link
Copy Markdown
Member Author

Thanks for the review!

@lovelydinosaur
lovelydinosaur merged commit 2f54b20 into master Dec 5, 2019
@lovelydinosaur
lovelydinosaur deleted the allow-default-and-override-timeout-style branch December 5, 2019 09:38
Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
Sign up for free to 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.

TimeoutConfig improvements. Fine-tuning timeouts from the default timeout config

2 participants