-
Notifications
You must be signed in to change notification settings - Fork 16
Job Name
Grant Carthew edited this page Feb 9, 2017
·
4 revisions
Prior to v2.3.0 of rethinkdb-job-queue
there was only one way to query or find jobs in the queue base on a job property. Using Queue.findJob is slow because it does not utilize an index in the database.
By using the Job.name property you can apply a label to your jobs which are backed by an index. This improves the retrieval speed of named jobs and reduces the load on the RethinkDB database.
Warning: The name
property of queue jobs is not guaranteed to be unique. Use the automatically generated Job.id and Queue.getJob for unique job access.
You can use the Job.name property for a number of purposes. Here are just a few ideas:
- Grouping jobs based on a common name value. Consider using multiple queues for this.
- Processing complex jobs.
- Using Queue.containsJobByName to test job existence.
- Complex Job - How you can use the job name property to perform advanced job processing.
- Job.name - The name property details.
- Job.setName - Helper method to set the job name property.
-
Queue.findJobByName - Use the
name
index to find named jobs. - Queue.containsJobByName - Test if the named job exists.
- 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