Home > @imqueue/core > IMessageQueue > subscribe

IMessageQueue.subscribe() method

Creates or uses a subscription channel with the given name and sets message handler on data receive

Signature:

subscribe(channel: string, handler: (data: JsonObject) => void): Promise<void>;

Parameters

Parameter

Type

Description

channel

string

channel name

handler

(data: JsonObject) => void

Returns:

Promise<void>