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 - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

2

package.json
{
"name": "activity-queue",
"version": "0.0.0",
"version": "1.0.0",
"description": "Easily track activity and when that activity flushes",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,7 +12,32 @@ # activity-queue

``` js
const flush-queue = require('flush-queue')
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
MIT
Apache-2.0
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