RateLimiter
RateLimiter copied to clipboard
Check if time limit is satisfied without waiting for it
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.