Skip to content

Queue.id

Grant Carthew edited this page Aug 19, 2016 · 11 revisions

Property Details

Usage: Read Only

Get: String

  • Returns a complex id string used to identify the Queue object process.

Example:

const Queue = require('rethinkdb-job-queue')
const q = new Queue()
let id = q.id
// As an example the id will be similar to this
// id === 'WebDev:rjqJobQueueTests:rjqJobQueueTestJobs:11797:2ff3db65-ffef-4a9b-a932-b6ac8bcc48a0'

Description

The Queue object id property is a very important value internally within rethinkdb-job-queue. From a consumers point of view, you probably will not need the Queue.id unless something is going wrong with your job processing.

The id value is created from the following colon separated information.

  • Server Name
  • Database Name
  • Table or Queue Name
  • Node.js Process Id
  • Generated UUID

During job processing the Queue.id is recorded against the Job.queueId property and each Job log entry. Every time a Queue object updates a job in the database, the Job.queueId will be updated to the Queue.id of the Queue object that made the change.

Using the updated Job.queueId value internally we can determine if queue changes have been made locally or not when the changeFeed queue option is enabled.

By doing this each Queue object within your code will raise events for the whole queue rather than just local events.

See the Queue Events document for more detail.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally