-
Notifications
You must be signed in to change notification settings - Fork 16
Queue Connection
When creating the Queue object you can supply options to define the location of the RethinkDB database. If you would prefer to supply a rethinkdbdash object you can replace the options with the driver object. See the Queue Constructor document for more detail.
Option | Type | Default |
---|---|---|
host | String | localhost |
port | Integer | 28015 |
db | String | rjqJobQueue |
This example is to show all the options being customized:
const Queue = require('rethinkdb-job-queue')
const cxnOptions = {
host: 'proddb.domain.com',
port: 10000,
db: 'JobQueue'
}
const qOptions = {
name: 'VideoProcess',
masterInterval: 1000,
changeFeed: true,
concurrency: 50,
removeFinishedJobs: false
}
const q = new Queue(cxnOptions, qOptions)
The host
option can be ignored if you are running RethinkDB on the same machine as the nodejs service. If not, point the queue to the server you have RethinkDB running on.
This example points the Queue object at an IP address:
const Queue = require('rethinkdb-job-queue')
const q = new Queue({ host: '192.168.1.10' })
This example points the Queue object at a DNS name:
const Queue = require('rethinkdb-job-queue')
const q = new Queue({ host: 'proddb.domain.com' })
The port
option allows you to specify the TCP port used by the RethinkDB database.
const Queue = require('rethinkdb-job-queue')
const q = new Queue({ port: 8000 })
Set the db
option to be the name of your job database in RethinkDB. The db
option will either create a new database if it does not exist, or use an existing database. If you would like your existing database to hold your job Tables, simply set the db
option to the existing name you are using in RethinkDB.
Important: There is no API call in rethinkdb-job-queue
that can drop the database. The Queue.drop method only drops the queue Table in the database, not the database itself.
const Queue = require('rethinkdb-job-queue')
const q = new Queue({ db: 'JobQueue' })
- 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