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

activity-queue

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

activity-queue

Easily track activity and when that activity flushes

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

activity-queue

Easily track when activity is drained

npm install activity-queue

Usage

const ActivityQueue = require('activity-queue')

const queue = new ActivityQueue()

const clock = queue.active()

const drained = queue.drained()

// await drained to know when its drained

queue.inactive(clock)

API

clock = queue.active()

Mark the queue as active. Returns the activity clock as an integer.

queue.inactive(clock)

Mark the activity done by passing the clock back.

promise = queue.drained()

Wait for the queue to drain. It's snapshot to the current state so any future activity events do not not count.

License

Apache-2.0

FAQs

Package last updated on 18 May 2024

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