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

callback-pool

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callback-pool

Simple utility to queue callbacks in a pool until the drain has been unplugged.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

callback-pool

Simple utility to queue callbacks in a pool until the drain has been unplugged.

npm install callback-pool --save

##Example

var pool = require('callback-pool');
var myPool = pool.create();//creates a new pool

//these are queued up
myPool.add(function(a, b){console.log('foo');});
myPool.add(function(a, b){console.log('boo');});

myPool.drain(1,2);//all callbacks are executed asynchronously with 1 and 2.

//these are now asynchronously executed immediately with 1 and 2
myPool.add(function(a, b){console.log('execute me');});
myPool.add(function(a, b){console.log('me too');});

myPool.plug();//allows you to start over.

Keywords

FAQs

Package last updated on 30 Jan 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

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