You're viewing archived documentation for @imqueue/core v2.0.26. APIs may differ from the current release. View the latest version ↗

ClusteredRedisQueue.send() method

Sends a message to given queue name with the given data. Supposed to be an async function.

Signature:

send(toQueue: string, message: JsonObject, delay?: number, errorHandler?: (err: Error) => void): Promise<string>;

Parameters

Parameter

Type

Description

toQueue

string

queue name to which message should be sent to

message

JsonObject

message data

delay

number

(Optional) if specified, a message will be handled in the target queue after a specified period of time in milliseconds.

errorHandler

(err: Error) => void

(Optional) callback called only when internal error occurs during message send execution.

Returns:

Promise<string>

{Promise} - message identifier