
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
@nextgis/queue
Advanced tools
Manage concurrent asynchronous tasks with abort capabilities
An advanced promise queue management library for JavaScript. This library is designed to handle the concurrency of any asynchronous tasks encapsulated in promises, providing optional debouncing to manage the flow of promise execution.
Simply download and include with a script tag, Queue
will be registered as a global variable.
<script src="../lib/queue.global.js"></script>
<script>
const queue = new Queue({ concurrency: 3, delay: 200 });
const asyncTask = function () {
return new Promise((resolve) => setTimeout(() => resolve("Task Complete"), 1000));
};
queue.add(asyncTask);
const asyncWithAbort = () => {
let timer;
const promise = new Promise((resolve) => {
timer = setTimeout(() => resolve("Another Task Complete"), 500);
});
const abortFunc = () => {
clearTimeout(timer);
console.log('Task was aborted');
};
return [promise, abortFunc]
}
queue.add(asyncWithAbort);
</script>
unpkg
<script src="https://unpkg.com/@nextgis/queue"></script>
jsdelivr
<script src="https://cdn.jsdelivr.net/npm/@nextgis/queue"></script>
We recommend linking to a specific version number /queue@[version]
npm install @nextgis/queue
import Queue from '@nextgis/queue';
const queue = new Queue({ concurrency: 2, delay: 100 });
const abortController = new AbortController();
queue.add(
() =>
fetch('https://api.example.com/data', {
signal: abortController.signal,
}),
abortController.abort,
);
// Demonstrating the abort function
setTimeout(() => {
queue.abort();
}, 100);
Check out the API Documentation
Need to fix a bug or add a feature to @nextgis/cache
? We provide custom development and support for this software. Contact us to discuss options!
FAQs
Manage concurrent asynchronous tasks with abort capabilities
The npm package @nextgis/queue receives a total of 30 weekly downloads. As such, @nextgis/queue popularity was classified as not popular.
We found that @nextgis/queue demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.