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

IMessageQueue.publish() method

Publishes data to current queue channel

If toName specified will publish to pubsub with different name. This can be used to implement broadcasting some messages to other subscribers on other pubsub channels. Different name should be in the same namespace (same imq prefix)

Signature:

publish(data: JsonObject, toName?: string): Promise<void>;

Parameters

Parameter

Type

Description

data

JsonObject

data to publish as channel message

toName

string

(Optional) different name of the pubsub to publish to {Promise}

Returns:

Promise<void>