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

v2: Add a settable global DEFAULT_TIMEOUT #1130

Open
coretl opened this issue Jun 29, 2023 · 0 comments
Open

v2: Add a settable global DEFAULT_TIMEOUT #1130

coretl opened this issue Jun 29, 2023 · 0 comments

Comments

@coretl
Copy link
Collaborator

coretl commented Jun 29, 2023

At the moment DEFAULT_TIMEOUT is hardcoded to 10s and used in a number of operations that should complete almost immediately. It would be useful to make this a global settable value for those times where something is being slow and you need just a bit more time.

This could be implemented in a few ways:

  • Provide global setter and getter functions, and use the getter function wherever we use DEFAULT_TIMEOUT. Care is needed in functions that take DEFAULT_TIMEOUT as an argument, a sentinal value will be needed as the default, to be replaced by the value of the getter function when called
  • Make DEFAULT_TIMEOUT not a float, but a custom class that evaluates to a float when float(DEFAULT_TIMEOUT) or num + DEFAULT_TIMEOUT is called. At least __float__() and __add__() would need to be overridden to support this.
  • Other cleverness that I have not thought of

How much magic do we want here?

@tacaswell @prjemian @RAYemelyanova

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

1 participant