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_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 and schedule next run

Source:

_poll_update()

Description:
  • Update visibilityTimeout for the item in ms

Source:

channel()

Description:
  • Return a subscription channel from the given name or options, the same client can support multiple subscriptions, additional subscriptions are specified by appending #channel to the options.queueName, default is to use the primary queue name. Consumer name if present is stripped off.

Source:

drop()

Description:
  • Drop a job in case of abnormal shutdown or exceeded run time

Source:

listen()

Description:
  • Listen for incoming messages

Source:

purge()

Description:
  • Purge all messages from the queue

Source:

schedule()

Description:
  • Schedule next poller iteration immediately or after timeout, check configured polling rate, 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:

submit()

Description:
  • Submit a job to a queue

Source:

unlisten()

Description:
  • Stop listening for messages

Source: