Home > @imqueue/rpc > ClusteredRedisQueue

ClusteredRedisQueue class

Class ClusteredRedisQueue Implements the possibility to scale queues horizontally between several redis instances.

Signature:

export declare class ClusteredRedisQueue implements IMessageQueue, EventEmitter<EventMap> 

Implements: IMessageQueue, EventEmitter<EventMap>

Constructors

Constructor

Modifiers

Description

(constructor)(name, options, _mode)

Class constructor

Properties

Property

Modifiers

Type

Description

logger

ILogger

Logger instance associated with this queue instance

{ILogger}

name

string

Methods

Method

Modifiers

Description

addListener(args)

addServer(server)

protected

Adds new servers to the cluster

clear()

Clears queue data in queue host application. Supposed to be an async function.

destroy()

Safely destroys the current queue, unregistered all set event listeners and connections. Supposed to be an async function.

emit(args)

eventNames()

getMaxListeners()

listenerCount(args)

listeners(args)

off(args)

on(args)

once(args)

prependListener(args)

prependOnceListener(args)

publish(data, toName)

queueLength()

rawListeners(args)

removeAllListeners(args)

removeListener(args)

removeServer(server)

protected

Removes server from the cluster

send(toQueue, message, delay, errorHandler)

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

setMaxListeners(args)

start()

Starts the messaging queue. Supposed to be an async function.

stop()

Stops the queue (should stop handling queue messages). Supposed to be an async function.

subscribe(channel, handler)

unsubscribe()