[#util-TokenBucket-2constructor]
= xref:util.adoc[util]::xref:util/TokenBucket.adoc[TokenBucket]::TokenBucket
:relfileprefix: ../../
:mrdocs:

Construct a token bucket with a given rate, initial balance, and capacity&period;

== Synopsis

Declared in `&lt;util&sol;tokenbucket&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
TokenBucket(
    double rate,
    double value,
    double cap);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rate*
| Tokens added per second&period;
| *value*
| Initial token balance (clamped to cap)&period;
| *cap*
| Maximum token balance&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
