QueueClient

module:queue. QueueClient

Base class for the queue clients, implements queue protocol in the same class, not supported methods just do nothing without raising any errors

Constructor

new QueueClient(options)

Source:
Parameters:
Name Type Description
options object

Methods

_poll_del()

Description:
  • Delete an item from the queue by id

Source:

_poll_emit()

Description:
  • Error safe emit, catch and report errors

Source:

_poll_get() → {Array.<object>}

Description:
  • Return a list of items from the queue

Source:
Returns:
Type Description
Array.<object>
  • { id, data }

_poll_run()

Description:
  • Perform a single run, pull messages, process all and schedule next run

Source:

_poll_run_item()

Description:
  • Run a single item

Source:

_poll_update()

Description:
  • Update visibilityTimeout for the item in ms

Source:

group()

Description:
  • Return the group name for the given queue, extract from queueName# or use options.groupName, empty string if no group is defined.

Source:

listen()

Description:
  • Listen for incoming messages

Source:

poll()

Description:
  • This method must take care how to retrieve messages during a single poll cycle, this is called by the schedule method automatically in the listen. The typical implementation when using default SQS like logic is just to use this._poll_run

Source:
Example
poll(options) {
    this._poll_run(options);
}

purge()

Description:
  • Purge all messages from the queue

Source:

schedule()

Description:
  • Schedule next poller iteration after pollInterval timeout, check configured maxPollRate, make sure it polls no more than configured number of times per second. If not ready then keep polling until the ready signal is sent.

    Two events can be used for back pressure support: pause and unpause to stop/restart queue processing

Source:

subject()

Description:
  • Return the full subject for the given queue to be used for submitting messages, as queueName.subject or queueName if no subject is defined.

Source:

submit()

Description:
  • Submit a job to a queue

Source:

subscription()

Description:
  • Return full subscription name as queueName@subject#group to be used by message listener

Source:

unlisten()

Description:
  • Stop listening for messages

Source: