-
Notifications
You must be signed in to change notification settings - Fork 16
Queue.containsJobByName
Grant Carthew edited this page Feb 10, 2017
·
3 revisions
Parameter: name
String
-
name
can be any string value.
Returns: Promise
=> Boolean
-
True
if the named job exists in the queue, otherwiseFalse
.
Example:
q.containsJobByName('batman'}).then((exist) => {
exist ? console.log('batman job exists')
: console.log('batman job does not exist')
}).catch(err => console.error(err))
This method is syntax sugar wrapping the Queue.findJobByName method call. If a job with the Job.name property equal to the name
value exists, you will get a true
result.
You will get a true
result from the query no matter what the values assigned to the jobs in the queue are. If the job has the same name as your query and has completed processing you will still get a true
result.
For more detailed analysis of the named jobs, use the Queue.findJobByName method.
If you are not setting the Job.name property, do not use this method. Instead use the Queue.getJob method supplying the Job.id.
This is a simple example checking for a named jobs existence.
const Queue = require('rethinkdb-job-queue')
const q = new Queue()
let job = q.createJob({ name: '12345678' })
q.containsJobByName('12345678').then((exists) => {
// The returned 'exists' value will be 'true'
}).catch(err => console.error(err))
- 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