How to use queue-promise - 1 common examples

To help you get started, we’ve selected a few queue-promise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Bartozzz / crawlerr / src / queue / promise.js View on Github external
start(): void {
        this.queue = new Queue({
            concurrency: this.opts.concurrency,
            interval: this.opts.interval,
        });

        this.handle(this.base)()
            .then(() => {
                this.queue.on("start", () => this.emit("start"));
                this.queue.on("stop", () => this.emit("stop"));
                this.queue.on("tick", () => this.emit("tick"));
                this.queue.on("resolve", (e) => this.emit("request", e));
                this.queue.on("reject", (e) => this.emit("error", e));

                this.queue.start();
            })
            .catch((error) => {
                this.emit("error", error);

queue-promise

A simple, dependency-free library for concurrent promise-based queues. Comes with with concurrency and timeout control.

MIT
Latest version published 4 years ago

Package Health Score

50 / 100
Full package analysis

Popular queue-promise functions