-
Notifications
You must be signed in to change notification settings - Fork 16
State Document
To enable the passing of messages to Queue objects in a distributed processing environment, rethinkdb-job-queue
uses a document in the queue table called the State Document.
Here is an example of the State Document:
{
dateChange: Thu Oct 06 2016 04:18:58 GMT+00:00,
id: '86f6ff5b-0c4e-46ad-9a5f-e90eb19c9b00',
queueId: 'WebDev::rjqJobQueueTestJobs:9302:3684e084-71a8-4ebc-8954-fb42a5e73ee9',
state: 'reviewed'
}
To make it easy to use the State Document the id
value is fixed and will never change. The State Document will always have an id
of 86f6ff5b-0c4e-46ad-9a5f-e90eb19c9b00
.
The Queue objects never read this document. It's purpose is to cause change feeds to be updated which in turn are converted to global state changes by each Queue object.
There are three state changes that occur within the queue:
paused
active
reviewed
If a Queue object receives a paused
global state update, it will change its own status to paused. This enables any Queue object to globally pause the queue. See Queue.pause for more detail.
If a Queue object receives an active
global state update, it will resume processing if paused. This enables any Queue object to globally resume the queue processing. See Queue.resume for more detail.
When a Queue Master completes the queue review process it updates the State Document to a state of reviewed
. All Queue objects connected to the queue will restart processing if their running
job count is less than their concurrency
value. See the Queue Master 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