BaseRedisBroker
Helper class with shared Redis logic
Extends
AsyncEventEmitter<ToEventMap<TEvents>>Implements
IBaseBroker<TEvents>Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
TEvents | Record<string, any> | No | None |
constructor(options)
Constructs a new instance of the
BaseRedisBroker
className | Type | Optional | Description |
---|---|---|---|
options | RedisBrokerOptions | No | None |
ProtectedReadonly
Options this broker is using
Used for Redis queues, see the 3rd argument taken by xadd
ProtectedReadonly
Internal copy of the Redis client being used to read incoming payloads
ProtectedReadonly
Events this broker has subscribed to
Destroys the broker, closing all connections
Handles an incoming Redis event
Name | Type | Optional | Description |
---|---|---|---|
id | Buffer | No | None |
group | string | No | None |
event | string | No | None |
data | unknown | No | None |
Protected
Begins polling for events, firing them to listen
Name | Type | Optional | Description |
---|---|---|---|
group | string | No | None |
Subscribes to the given events, grouping them by the given group name
Name | Type | Optional | Description |
---|---|---|---|
group | string | No | None |
events | (keyof TEvents)[] | No | None |
Unsubscribes from the given events - it's required to pass the same group name as when subscribing for proper cleanup
Name | Type | Optional | Description |
---|---|---|---|
group | string | No | None |
events | (keyof TEvents)[] | No | None |