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

futurus

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

futurus

A queue that lets you see into the future

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Futurus

Build Status

About to be

A queue that exposes a lot of state about how its handling your tasks. In particular, futurus can tell you whether a task you're about to add will be processed immediately or buffered.

Usually you shouldn't care about this sort of thing, but this one time I did and so futurus was born.

Example

var worker = function (data, callback) {
  setTimeout(function () {
    console.log(data)
  }, 100)
}
var queue = new futurus.Queue(2, worker)
queue.on('ready', function () {
  console.log('The queue has just become ready')
})
queue.on('drain', funciton () {
  console.log('The queue has no active jobs')
})

queue.push('hello')
console.log(queue.isReady())
// true

queue.push('world')
console.log(queue.isReady())
// false

queue.push('hello')
console.log(queue.isReady())
// false

// (Wait a few hundred milliseconds)
// 'The queue has just become ready'

// (Wait a few hundred milliseconds more)
// 'The queue has no active jobs'

FAQs

Package last updated on 25 Aug 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