-
Notifications
You must be signed in to change notification settings - Fork 16
Job Schema
For reference purposes this document shows the schema of a job as it is saved in the RethinkDB database.
Below is a JSON representation of a job in the queue. This job contains valid data although it does not have any log entries.
Note: The example here is describing the job schema only, not your own data for job processing. You can populate your jobs with any properties you like. See the Tutorial document for more detail.
{
dateCreated: 2016-09-19T03:07:44.394Z,
dateEnable: 2016-09-19T03:12:44.451Z,
dateFinished: 2016-09-19T03:07:44.469Z,
dateStarted: 2016-09-19T03:07:44.451Z,
id: '5127d082-fe7e-4e88-b1de-7093029695c3',
log: []
name: '5127d082-fe7e-4e88-b1de-7093029695c3',
priority: 'normal',
processCount: 1
progress: 0,
queueId: 'WebDev::rjqJobQueueTestJobs:1942:ebc89e54-f7d3-40a1-952a-3bb152d154ce',
repeat: false,
repeatDelay: 300000,
retryCount: 0,
retryDelay: 600000,
retryMax: 3,
status: 'completed',
timeout: 300000
}
Following is a breakdown of all of the job properties and a brief description of what they are used for. Click on the document links inline for more detail.
-
dateCreated
: The date is added when the job is created and should never change. -
dateEnable
: Jobs will not be processed until the current date is past this date. -
dateFinished
: Records the date when a job completes, fails, gets cancelled, or is terminated. -
dateStarted
: The date the job processing was last started. It may be a retry start date. -
id
: The document id within the RethinkDB database. -
log
: An array of log entries created from within the Queue object or by using Job.addLog. -
name
: A string value used to identify the job. See the Job Name document for more detail. -
priority
: A number representing the processing order of the jobs. -
processCount
: The number of times the job has been processed or attempted to be processed. -
progress
: The user reported progress for the job. Updated with Job.updateProgress. -
queueId
: A string representing the Queue object that last updated the job in the database. -
repeat
: Whether the job will repeat. -
repeatDelay
: The delay between repeats. -
retryCount
: A record of the number of retry attempts the job has had. -
retryDelay
: The time delay in milliseconds before failed jobs will be retried. -
retryMax
: The maximum number of retries before the job is terminated. -
status
: The current status of the job. -
timeout
: How long the job can be processed for before it is considered failed.
Although rethinkdb-job-queue
supports a search feature by calling Queue.findJob and Queue.findJobByName, you can use the job schema above and the RethinkDB driver to build your own search functionality. Apart from searching you could augment the jobs in the database any way you like.
The RethinkDB driver is available to you by calling Queue.r. Once you have that you can use the RethinkDB API and the rethinkdbdash API to interact with the job documents in the database.
As an example of how flexible this can be, you could search the database for jobs that have been completed and change the properties of the jobs to rerun them.
Please refer to the RethinkDB and rethinkdbdash documentation 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