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

Is it possible to set an infinite timeout? #10

Open
ciresnave opened this issue Jul 1, 2024 · 1 comment
Open

Is it possible to set an infinite timeout? #10

ciresnave opened this issue Jul 1, 2024 · 1 comment

Comments

@ciresnave
Copy link

Is it possible to have no timeout and wait for something forever? For example, I have a variable that may or may not ever change but need to check for it changing periodically. situwaition seems like a good crate to accomplish that except that I don't want a timeout. Instead, I want it to wait indefinitely. I'm sure I could wrap something around situwaition to start waiting again any time there is a timeout or I could simply set the timeout to such a ridiculously long duration that the timeout would never happen within the plausible run time of my code...but I figured I would ask if there was a way to actually specify that I don't want situwaition to time out.

@t3hmrman
Copy link
Owner

t3hmrman commented Jul 1, 2024

This is currently not implemented, but possible. For a quick workout you can set an obscene timeout length (generally I don't expect a system to be up for a solid year retrying the same check), but obviously that's not ideal.

I think one easy way to do this in a breaking change (new minor version) would be to make the timeout optional -- or an enum that represents running forever vs running with a timeout!

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