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

Support custom timeout management #179

Closed
alexgolec opened this issue Feb 24, 2021 · 4 comments · Fixed by #315
Closed

Support custom timeout management #179

alexgolec opened this issue Feb 24, 2021 · 4 comments · Fixed by #315

Comments

@alexgolec
Copy link
Owner

alexgolec commented Feb 24, 2021

Is your feature request related to a problem? Please describe.
HTTPX defaults to 5s timeouts, and some users require longer and/or no timeouts.

Describe the solution you'd like
Start using a client object and expose it to the user so they can set their HTTPX settings.

Describe alternatives you've considered
N/A

Additional context
N/A

@codyfletcher
Copy link

Hey @alexgolec, great work on tda-api. Thank you! ⭐️

Quick question, are you open to splitting this into 2 separate issues:

  1. Explicitly set a longer default timeout for tda-api, say 15-30s? The thought being that—while 5s is a sane default for HTTPX and most projects—TDA can't seem to serve up historical transactions and/or orders within 5 seconds even if the queried date range is narrow (e.g. 2020-06-01 to 2020-06-02).

  2. Keep this current issue as-is as a follow up issue. It's a better solution but a more time-intensive one.

@codyfletcher
Copy link

Found this on discord. Posting here in case it's of value to others.

import httpx

fine_grained_timeout = httpx.Timeout(5.0, connect=1.0)
tda_client.session.timeout = fine_grained_timeout

@alexgolec
Copy link
Owner Author

That's good feedback. I've put together a PR that will address both points.

@alexgolec alexgolec linked a pull request Jun 5, 2022 that will close this issue
@codyfletcher
Copy link

Thanks @alexgolec, you're CRUSHING it!

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 a pull request may close this issue.

2 participants