$ open source · GPL-3.0 — need a commercial license? imqueue.com →

Home > @imqueue/core > ICluster

ICluster interface

Membership callbacks a clustered queue hands to a ClusterManager so the manager can add and remove servers as it discovers them.

Implement this to feed a clustered queue from your own discovery mechanism; ClusteredRedisQueue supplies an implementation of its own.

Signature:

export interface ICluster 

Properties

Property

Modifiers

Type

Description

add

(server: IServerInput) => IMessageQueueConnection

Adds a server to the cluster and returns its registration record. Registration is idempotent — an already-known server is returned unchanged.

find

(server: IServerInput) => IMessageQueueConnection | undefined

Looks a server up, matching by id when both sides carry one and by host and port otherwise. Returns undefined when it is not registered.

remove

(server: IServerInput) => void

Removes a server from the cluster. A no-op when the server is unknown.