IMessageQueue interface
Generic messaging queue implementation interface
Signature:
export interface IMessageQueue extends EventEmitter
Extends: EventEmitter
Example
~~~typescript import { IMessageQueue, EventEmitter, uuid } from '@imqueue/core';
class SomeMQAdapter implements IMessageQueue extends EventEmitter { public async start(): Promise
Methods
|
Method |
Description |
|---|---|
|
Clears queue data in queue host application. Supposed to be an async function. | |
|
Safely destroys current queue, unregistered all set event listeners and connections. Supposed to be an async function. | |
|
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) | |
|
Sends a message to given queue name with the given data. Supposed to be an async function. | |
|
Starts the messaging queue. Supposed to be an async function. | |
|
Stops the queue (should stop handle queue messages). Supposed to be an async function. | |
|
Creates or uses subscription channel with the given name and sets message handler on data receive | |
|
Closes subscription channel {Promise |