Socket
Book a DemoInstallSign in
Socket

promisegate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promisegate

Limits promise concurrency

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

promisegate

Takes (args...) -> Promise and turns it into (args...) -> Promise with limited concurrency.
Useful for capping expensive async calls (e.g. image processing).
Arguments are proxied to the wrapped function.

Assumes your promise library of choice defines .resolve, .defer and .prototype.finally.

var Promise = require('bluebird');
var gate = require('promisegate')(Promise) // pass promise lib of your choice

var someFunctionReturningPromise = gate.limit(function () {
  // do work
}, 666);

But actually, it's about ethics in game journalism.

Keywords

async

FAQs

Package last updated on 31 Oct 2014

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