Skip to content

Event.pausing

Grant Carthew edited this page Nov 19, 2016 · 3 revisions

Event Details

Subject: Queue

Signature: (queueId, global)

Returns: queueId String

  • The Queue.id for the Queue object which is pausing the queue.

Returns: global Boolean

  • A flag to indicate if the pause is global or local.

Example:

const Queue = require('rethinkdb-job-queue')
const q = new Queue()

q.on('pausing', (queueId, global) => {
  console.log('Queue pausing: ' + queueId)
  console.log('Pause global: ' + global)
})

Description

The pausing event is raised when a Queue object is being paused by calling the Queue.pause method. Use the global argument to determine if the pause is applying to the entire queue or just the local Queue object.

Because the Queue.pause method waits for running jobs to finish, it could be some time before the Queue object is paused. You can use the pausing event to do some tidy up before the Queue object is completely paused.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally