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

Check if time limit is satisfied without waiting for it #38

Open
alexb5dh opened this issue Mar 29, 2023 · 0 comments
Open

Check if time limit is satisfied without waiting for it #38

alexb5dh opened this issue Mar 29, 2023 · 0 comments

Comments

@alexb5dh
Copy link

alexb5dh commented Mar 29, 2023

Is it possible to check that TimeLimiter instance is available (await will return immediately) without actually awaiting it?

Use case: non-blocking rate limiting. A method is being called in a loop and if execution is attempted outside of allowed time constrains, method should just return immediately without blocking the caller.

TimeLimiter.GetAwaiter().IsCompleted is programmed to always return false, so is not an option.

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