Qiita で golang.org/x/time/rate でレイトリミット - Qiita という記事を見かける。 golang.org/x/time/rate は,いわゆる「トークンバケット(token bucket)」アルゴリズムを実装するためのパッケージのようだ。 トークンバケット・アルゴリズムとは A token is added to the bucket every $1/r$ seconds. The bucket can hold at the most $b$ tokens. If a token arrives when the bucket is full, it is discarded. When a packet (network layer PDU) of $n$ bytes arrives, if at least $n$ tokens are in t
![Go による Token Bucket 実装](https://cdn-ak-scissors.b.st-hatena.com/image/square/d10addccef9c7773072a5ec748deb629e26bc669/height=288;version=1;width=512/https%3A%2F%2Ftext.baldanders.info%2Fimages%2Fattention%2Fgo-logo_blue.png)