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 REST requests timeout, especially with StockHistoricalDataClient #415

Open
1 task done
impredicative opened this issue Mar 6, 2024 · 0 comments
Open
1 task done
Assignees

Comments

@impredicative
Copy link

impredicative commented Mar 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

Currently when getting StockBarsRequest, I cannot specify a requests timeout. Sometimes it takes too long to return, as much as 7 seconds.

Describe the solution you'd like.

The requests package supports a timeout argument. It should be possible for me to optionally provide this argument when I initialize StockHistoricalDataClient. I would then use two instances of this client, one without a timeout, and one with a timeout when I need it.

In this way, I can myself easily then retry the request if it takes longer than say 2 seconds instead of waiting for 7 seconds. Usually it returns very quickly.

The default behavior should continue to remain as it is now.

Describe an alternate solution.

No response

Anything else? (Additional Context)

Without this feature I have to use requests myself which may be undesirable. [example]

@impredicative impredicative changed the title Support REST requests timeout Support REST requests timeout, especially with StockHistoricalDataClient Mar 6, 2024
@hiohiohio hiohiohio self-assigned this Mar 7, 2024
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

No branches or pull requests

2 participants