Socket
Book a DemoInstallSign in
Socket

@martin-kolarik/batch-queue

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@martin-kolarik/batch-queue

Batch queue

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
506
133.18%
Maintainers
0
Weekly downloads
 
Created
Source

batch-queue

Installation

$ npm install @martin-kolarik/batch-queue

Usage

const BatchQueue = require('@martin-kolarik/batch-queue');

const batchQueue = new BatchQueue(async (items) => {
    // TODO: process `items` here.
}, /* list of options with their default values: */ {
    batchSize: 100, // process 100 items at once
    concurrency: 1, // run at most 1 instance of the processing function at a time
    timeout: 1000, // process the items after 1000 ms even if items.length < batchSize
});

batchQueue.push(...items);

Run npm test for examples.

License

Copyright (c) 2019 Martin Kolárik. Released under the MIT license.

FAQs

Package last updated on 09 Dec 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