Skip to content

Queue API

Grant Carthew edited this page Mar 20, 2017 · 18 revisions

Description

There are two main public objects within rethinkdb-job-queue being the Queue object and the Job object.

The Queue object is your main interface. You use the Queue to create Job objects and also to add the Job objects to the job queue. The Queue is also used to process your jobs.

Job objects are stored in the RethinkDB database and contain the details or data required for your job processing.

API Type Description
Queue.createJob Method Used to create one or more Job objects
Queue.addJob Method Adds Job objects to the queue for processing
Queue.getJob Method Returns updated jobs from the Queue
Queue.findJob Method Returns an array of jobs based on a predicate filter
Queue.findJobByName Method Returns an array of jobs based on a string name
Queue.containsJobByName Method Returns a boolean if a job with the name exists
Queue.cancelJob Method Permanently cancels one or more jobs in the Queue
Queue.reanimateJob Method Re-enables a job that was cancelled or terminated
Queue.removeJob Method Permanently removes one or more jobs from the Queue
Queue.process Method Accepts your processing handler function
Queue.review Method Initiates the Queue review process
Queue.summary Method Produces a Queue status summary report object
Queue.ready Method Indicates the ready state of the Queue
Queue.pause Method Use to pause the Queue
Queue.resume Method Use to resume a paused Queue
Queue.reset Method Removes all jobs from the Queue or empties the Queue
Queue.stop Method Stops the Queue for graceful shutdown
Queue.drop Method Stops the Queue and drops the database table
Queue.host Property RethinkDB host name or IP address [Read Only]
Queue.port Property RethinkDB access port number [Read Only]
Queue.db Property RethinkDB database name [Read Only]
Queue.name Property Name of the Queue (Database Table) [Read Only]
Queue.r Property The rethinkdbdash instance [Read Only]
Queue.id Property Queue identification string [Read Only]
Queue.jobOptions Property Defines the default options applied to new jobs
Queue.changeFeed Property Queue change feed instance [Read Only]
Queue.master Property Queue master status [Read Only]
Queue.masterInterval Property The master Queue review interval [Read Only]
Queue.limitJobLogs Property Limits maximum job log entries [Read Only]
Queue.removeFinishedJobs Property Queue clean up configuration [Read Only]
Queue.running Property Number of jobs being processed [Read Only]
Queue.concurrency Property Maximum number of concurrent jobs
Queue.paused Property Pause state of the Queue [Read Only]
Queue.idle Property Idle state of the Queue [Read Only]
Event.ready Event The Queue object is ready
Event.added Event Job has been added to the queue
Event.updated Event Job has been updated in the queue
Event.active Event Job status has been changed to active
Event.processing Event Job is being processed
Event.progress Event Job progress has been updated
Event.log Event Custom Job log entry has been added
Event.pausing Event Queue object is been paused
Event.paused Event Queue object has been paused
Event.resumed Event Queue object has been resumed
Event.completed Event Job processing has been completed
Event.cancelled Event Job has been cancelled
Event.failed Event Job has failed processing
Event.terminated Event Job has failed and will not be retried
Event.reanimated Event Job has been reanimated
Event.removed Event Job has been removed from the queue
Event.idle Event Queue is not processing jobs
Event.reset Event All jobs on the queue have been removed
Event.error Event An error has occurred
Event.reviewed Event Queue Master review process has completed
Event.detached Event RethinkDB connection pool has been drained
Event.stopping Event Queue is stopping
Event.stopped Event Queue is stopped and detached
Event.dropped Event Queue database table has been dropped

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally