Function ThrottlerImpl.withdraw

Withdraw tokens from the bucket.

void withdraw (
  ulong tokens,
  Timeout timeout = Timeout.infinite
) @nogc @safe;

Unless AllowOverdraft is true, the amount of tokens requested must be smaller than the burst size. If AllowOverdraft is false and there is insufficient ballance, or if AllowOverdraft is true but the ballance is negative, then the requester is paused until all prior reuqesters have been served and the ballance is high enough to serve the current request.

Parameters

NameDescription
tokens number of tokens to withdraw.
timeout sets a timeout for the wait.

Throws

TimeoutExpired if the timeout expires.

Any other exception injected to this fiber using Reactor.throwInFiber