Skip to content

Queue.stop

Grant Carthew edited this page Nov 11, 2016 · 7 revisions

Method Signature

Queue.Stop()

Returns: Promise => true

  • Will only ever resolve to true.

Example:

q.stop().then(() => {
  // The Queue object is now stopped
}).catch(err => console.error(err))

Description

The Queue.stop method call is very different to Queue.pause. If a Queue object is paused, you can resume it easily.

When you call Queue.stop the Queue object is detached from the database. The RethinkDBDash driver connection pool is drained and the Queue object, for all intents and purposes, is dead.

It is easy to recover from if you need to. Simply remove all references to the current Queue object and create a new one const q = new Queue().

Calling Queue.stop will first pause the Queue object. This means it could take some time to resolve the Promise. The method will not resolve until all running jobs have completed.

As a final note, Queue.ready will resolve successfully after calling Queue.stop, however the resolved value will be false. See the Queue.ready 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