Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
burst-queue
Advanced tools
A simple queue that takes functions and executes those functions on a specified interval. Optionally a maximum number of functions to execute per interval can be specified when creating a burst-queue.
Returns: a burst-queue that will execute passed in functions every period
(milliseconds). The optional functionsPerPeriod
value denotes a maximum number of functions to be executed at each interval.
Adds functions to the queue. The add
method takes both single functions or arrays of functions.
Returns: the queue's internal id(s) of the passed in functions. The internal ids can be later used to remove
items from the queue. If an array of functions is passed to add
, an array of ids is returned in the same order as the functions that were passed in.
Only valid when functionsPerPeriod
is defined.
Returns: the number of calls available in the current period. In other words, any function passed in when availableCalls()
returns a value greater than 0 will be executed immediately.
Clears the queue of all functions. Sets the availableCalls
back to the original value of functionsPerPeriod
that was specified on creation of the queue. If no value was given for functionsPerPeriod
, availableCalls
remains at 0.
Returns: nothing
Returns: the current value of the counter used for generating the queue's internal ids for functions. This value increments by one each time a function is added to the queue.
Returns: the current count of items in the queue.
Takes an id returned from an add
call and removes that function from the queue, if it is still in the queue.
Returns: a bool that designates whether the remove
call successfully found and removed the function from the queue. If a function no longer exists in the queue when remove
is called on its id, remove
returns false
.
FAQs
a queue that executes functions in predefined bursts
We found that burst-queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.