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

Add overall timeout support #936

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Add overall timeout support #936

wants to merge 8 commits into from

Conversation

karpetrosyan
Copy link
Member

@karpetrosyan karpetrosyan commented Jul 13, 2024

Todo

  • Update documentation

Hi! It seems we have received many requests for adding total timeout support.

In each place where we are using the operation (read, write, pool, connect) timeout, we should take the minimum value of the operation timeout (timeouts['pool'], for example) and the total timeout value (timeouts['total']). We should also measure the time of each operation and adjust the value of the total timeout accordingly, so we always have the correct total timeout value within the scope of the request.

I'v used the context manager syntax to simplify time measuring, also have added a simple api level test for total timeout, as we don't have any tests for the concrete timeouts

@karpetrosyan
Copy link
Member Author

@tomchristie Any thoughts?

@tomchristie
Copy link
Member

Thanks @karpetrosyan...

Any thoughts?

  • This is a fantastic piece of functionality to add yes, much needed.
  • Could we get a docs update.
  • Related work that's become apparent to me is that read/write timeouts are the wrong API... a single socket timeout would be a better fit.

docs/extensions.md Outdated Show resolved Hide resolved
@karpetrosyan
Copy link
Member Author

I guess that's all from our side. The remaining documentation will be available in the HTTPX docs.

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

Successfully merging this pull request may close these issues.

None yet

2 participants