class PubSubRedisBroker

export declare class PubSubRedisBroker<TEvents extends Record<string, any>> extends BaseRedisBroker<TEvents> implements IPubSubBroker<TEvents>

PubSub broker powered by Redis

Type Parameters

TEvents extends Record<string, any>

protected
listening : boolean

Whether this broker is currently polling events

Inherited from: BaseRedisBroker

protectedreadonly
options : Required<RedisBrokerOptions>

Options this broker is using

Inherited from: BaseRedisBroker

protectedreadonly
redisClient : Redis

Inherited from: BaseRedisBroker

staticreadonly
STREAM_DATA_KEY :

Used for Redis queues, see the 3rd argument taken by xadd

Inherited from: BaseRedisBroker

protectedreadonly
streamReadClient : Redis

Internal copy of the Redis client being used to read incoming payloads

Inherited from: BaseRedisBroker

protectedreadonly
subscribedEvents : Set<string>

Events this broker has subscribed to

Inherited from: BaseRedisBroker

destroy() : Promise<void>

Destroys the broker, closing all connections

Inherited from: BaseRedisBroker

protected
emitEvent(
id: Buffer
group: string
event: string
data: unknown
) : void

protected
listen() : Promise<void>

Begins polling for events, firing them to listen

Inherited from: BaseRedisBroker

publish<

Event extends keyof TEvents

>(
event: Event
data: TEvents[Event]
) : Promise<void>

Publishes an event

subscribe(
events: (keyof TEvents)[]
) : Promise<void>

Subscribes to the given events

Inherited from: BaseRedisBroker

unsubscribe(
events: (keyof TEvents)[]
) : Promise<void>

Unsubscribes from the given events

Inherited from: BaseRedisBroker