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.
Sends a message to given queue name with the given data. Supposed to be an async function.
queue name to which message should be sent to
message data
Starts the messaging queue. Supposed to be an async function.
Stops the queue (should stop handle queue messages). Supposed to be an async function.
Generic messaging queue implementation interface
import { IMessageQueue, EventEmitter, uuid } from '@imqueue/core'; class SomeMQAdapter implements IMessageQueue extends EventEmitter { public async start(): Promise<SomeMQAdapter> { // ... implementation goes here return this; } public async stop(): Promise<SomeMQAdapter> { // ... implementation goes here return this; } public async send( toQueue: string, message: IJson, delay?: number ): Promise<string> { const messageId = uuid(); // ... implementation goes here return messageId; } public async destroy(): Promise<void> { // ... implementation goes here } public async clear(): Promise<SomeMQAdapter> { // ... implementation goes here return this; } }