-
Notifications
You must be signed in to change notification settings - Fork 16
Queue.addJob
Parameter: Job
- One or more Job objects from Queue.createJob.
Returns: Promise
=> Array
- An array of one or more Job objects.
Example:
q.addJob(jobs).then((savedJobs) => {
// savedJobs is an array of one or more Jobs
}).catch((err) => {
console.error(err)
})
To use rethinkdb-job-queue
you need to add Job objects to the Queue. Job objects can be created by using the Queue.createJob method.
After calling Queue.createJob you will have a valid Job object which is only stored in local memory. This Job object can now be populated with any data you will need to process the job.
At this point in time, the Job is not in the Queue and will not be processed. Calling Queue.addJob(job)
will save the job into the backing database table and expose the job to any node available to process it.
Queue.addJob(job)
returns a bluebird
Promise. If you are using a different Promise library or a different version of bluebird
, ensure you encapsulate the returned Promise in your own promises.
- 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