ThrottlerImpl.open

initialize a throttler for use.

  1. void open(size_t tokensPerSecond, ulong burstSize)
    struct ThrottlerImpl(bool AllowOverdraft = false)
    nothrow @safe @nogc
    void
    open
    (,
    ulong burstSize
    )
  2. void open(size_t tokensPerSecond, ulong burstSize, ulong numInitialTokens)

Parameters

tokensPerSecond size_t

the rate at which new tokens are deposited at the bucket. Actual rate might vary slightly due to rounding errors. In general, the lower the number, the lower the error.

burstSize ulong

the maximal number of tokens that the bucket may hold. Unless overdraft is allowed, this is also the maximal amount that a single withdrawl may request.

Meta