Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 545 Bytes

README.md

File metadata and controls

19 lines (11 loc) · 545 Bytes

Token Bucket

Create a token bucket algorithm in Javascript

Why is useful?

Is useful when you have to throtle something, example in a rate limiter API

Description

A token bucket is a container that has a default capacity, tokens are put in the bucket at preset rates periodically. Once the bucket is full, no more tokens are added, the extra tokens will overflow

token bucket

Algorithms

  • Token bucket
  • Leaking bucket