Construct a token bucket with a given rate, initial balance, and capacity.

Synopsis

Declared in <util/tokenbucket.h>

TokenBucket(
    double rate,
    double value,
    double cap);

Parameters

Name

Description

rate

Tokens added per second.

value

Initial token balance (clamped to cap).

cap

Maximum token balance.

Created with MrDocs