Skip to content

Queue.concurrency

Grant Carthew edited this page Aug 19, 2016 · 2 revisions

Property Details

Usage: Read Write

Set: Number

  • The new concurrency value you want for the Queue object.

Get: Number

  • Find out the currently configured concurrency value.

Example:

const Queue = require('rethinkdb-job-queue')
const q = new Queue()
let concurrency = q.concurrency
// concurrency === 1

q.concurrency = 500
concurrency = q.concurrency
// concurrency === 500

Description

The Queue.concurrency property is very flexible.

If you set the concurrency for the Queue object to be 100, the Queue object will start processing 100 jobs maximum. If you then adjust the concurrency value to 10, as the jobs finish off the Queue.running property will report a falling number of jobs being processed until it hits 10.

You can change the concurrency at any time to any positive value.

Warning: If your jobs will block the Node.js process, consider scaling out your queue to multiple Node.js processes.

See the Queue Options document for more detail.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally