Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaky-bucket-queue

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaky-bucket-queue

An implementation of burstable throtling algorithm on top of rxjs

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

leaky-bucket-queue

An implementation of leaky bucket on top of rxjs.

Simple rate limiting are usually good enough for most scenario but they might incur unnecessary stuttering when there is attempt to make multiple call to a server API. Leaky bucket provides a burstable solution, providing rate limit while allowing bursty traffic, making application more responsive.

Installation

npm i leaky-bucket-queue

Usage

Typescript

import { LeakyBucketQueue } from 'leaky-bucket-queue';

const queue = new LeakyBucketQueue<string>({ burstSize: 5, period: 100 });
queue.consume().subscribe({
  next: console.log,
});
queue.enqueue('compter');
...

JavaScript

import { LeakyBucketQueue } from 'leaky-bucket-queue';

const queue = new LeakyBucketQueue({ burstSize: 5, period: 100 });
queue.consume().subscribe({
  next: console.log,
});
queue.enqueue('explode');
...

Keywords

FAQs

Package last updated on 06 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc