Skip to main content

RateLimiter

No overview available.

Methods


Wait()

@classmethod
def Wait(
ctx: context.Context
) - > error

Blocks until the rate limiter permits an event to proceed, or until the provided context is cancelled. Callers use this to ensure that operations adhere to a predefined rate limit.

Parameters

NameTypeDescription
ctxcontext.ContextThe context that can be used to cancel the wait operation. If the context is cancelled, the method will return an error.

Returns

TypeDescription
errorAn error if the context is cancelled before the wait completes, otherwise nil.