Skip to content

Implement Leaky Bucket Algorithm #54

@shalarewicz

Description

@shalarewicz

Implement LeakyBucket class per the spec in #50. The implementation should pass the tests written in #52

The LeakyBucket algorithm works similarly to TokenBucket except that requests are processed at a fixed rate. The algorithm is usually implemented with a FIFO queue and works as follow:

  • When a request arrives, the limiter checks if the queue is full. If it is not full, the request is added to the queue.
  • Otherwise, the request is dropped (a 429 status is sent)
  • Requests are pulled from the queue and processed at regular intervals

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or requesttestingRequires tests to be created or modified

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions