-
Notifications
You must be signed in to change notification settings - Fork 16
Queue.concurrency
Grant Carthew edited this page Aug 19, 2016
·
2 revisions
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
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.
- Introduction
- Tutorial
- Queue Constructor
- Queue Connection
- Queue Options
- Queue PubSub
- Queue Master
- Queue Events
- State Document
- Job Processing
- Job Options
- Job Status
- Job Retry
- Job Repeat
- Job Logging
- Job Editing
- Job Schema
- Job Name
- Complex Job
- Delayed Job
- Cancel Job
- Error Handling
- Queue.createJob
- Queue.addJob
- Queue.getJob
- Queue.findJob
- Queue.findJobByName
- Queue.containsJobByName
- Queue.cancelJob
- Queue.reanimateJob
- Queue.removeJob
- Queue.process
- Queue.review
- Queue.summary
- Queue.ready
- Queue.pause
- Queue.resume
- Queue.reset
- Queue.stop
- Queue.drop
- Queue.Job
- Queue.host
- Queue.port
- Queue.db
- Queue.name
- Queue.r
- Queue.id
- Queue.jobOptions [R/W]
- Queue.changeFeed
- Queue.master
- Queue.masterInterval
- Queue.removeFinishedJobs
- Queue.running
- Queue.concurrency [R/W]
- Queue.paused
- Queue.idle
- Event.ready
- Event.added
- Event.updated
- Event.active
- Event.processing
- Event.progress
- Event.log
- Event.pausing
- Event.paused
- Event.resumed
- Event.completed
- Event.cancelled
- Event.failed
- Event.terminated
- Event.reanimated
- Event.removed
- Event.idle
- Event.reset
- Event.error
- Event.reviewed
- Event.detached
- Event.stopping
- Event.stopped
- Event.dropped
- Job.setName
- Job.setPriority
- Job.setTimeout
- Job.setDateEnable
- Job.setRetryMax
- Job.setRetryDelay
- Job.setRepeat
- Job.setRepeatDelay
- Job.updateProgress
- Job.update
- Job.getCleanCopy
- Job.addLog
- Job.getLastLog