|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <token_bucket.h>
Public Member Functions | |
| TokenBucket (int size, std::chrono::steady_clock::duration refill) | |
| bool | Take (std::chrono::steady_clock::time_point now) |
| Takes a token out, if the bucket has one at this time. | |
Lets up to size through at once, and then one each refill, like a bucket of tokens that fills up again over time, where each one let through takes a token out.
Definition at line 11 of file token_bucket.h.
| nanommo::TokenBucket::TokenBucket | ( | int | size, |
| std::chrono::steady_clock::duration | refill ) |
Definition at line 8 of file token_bucket.cc.
| bool nanommo::TokenBucket::Take | ( | std::chrono::steady_clock::time_point | now | ) |
Takes a token out, if the bucket has one at this time.
Definition at line 11 of file token_bucket.cc.