Global

Type Definitions

Priority

Priority object.

Type:
Properties:
Name Type Attributes Description
priorityName string

Name of the priority.

before string <optional>

The queue which this priority should be added before.

QueueOptions

Queue options.

Type:
  • Object
Properties:
Name Type Attributes Description
queueName string <optional>

Name of the queue.

once boolean <optional>

Execute only once by namespace and taskName.

run boolean <optional>

Run the queue if not running yet.

Task

Complete Task object.

Type:
Properties:
Name Type Description
method WrappedMethod

Function to be queued.

taskName string

Name of the task.

TaskOptions

Task options.

Type:
Properties:
Name Type Attributes Description
reject function <optional>

Reject callback.

WrappedMethod()

RunAsync creates a promise and executes wrappedMethod inside the promise. It replaces async property of the wrappedMethod's context with one RunAsync provides. async() simulates an async function by creating a callback.

It supports promises/async and sync functions.

  • Promises/async: forward resolve/reject from the runAsync promise to the promise returned by the wrappedMethod.
  • Sync functions: resolves with the returned value. Can be a promise for chaining
  • Sync functions with callback (done = this.async()) calls: Reject with done(rejectValue) first argument Resolve with done(undefined, resolveValue) second argument
  • Callback must called when 'async()' was called inside a sync function.
  • Callback can be ignored when 'async()' was called inside a async function.