Connectum API Reference / @connectum/events-redis / types / RedisLifecycleEvent
Type Alias: RedisLifecycleEvent ​
RedisLifecycleEvent = {
connection:RedisLifecycleConnection;reconnected:boolean;type:"connected"; } | {connection:RedisLifecycleConnection;error:Error;type:"disconnected"; } | {attempt:number;connection:RedisLifecycleConnection;delay:number;error:Error;type:"reconnecting"; } | {connection:RedisLifecycleConnection;error:Error;type:"reconnect-failed"; } | {callback:string;error:Error;event:string;type:"lifecycle-error"; }
Defined in: types.ts:85
Connection lifecycle events of the Redis adapter, delivered to RedisLifecycleCallbacks.onLifecycle.
A discriminated union on type. The strings and the shared fields match the AMQP adapter's events; the type is local to this package. The adapter holds one publishing connection and one blocking connection per subscription, so one broker loss is reported once per connection (connection says which).
Union Members ​
Type Literal ​
{ connection: RedisLifecycleConnection; reconnected: boolean; type: "connected"; }
connection ​
readonlyconnection:RedisLifecycleConnection
reconnected ​
readonlyreconnected:boolean
type ​
readonlytype:"connected"
A connection became ready: for the first time (reconnected: false) or after a loss (reconnected: true).
Type Literal ​
{ connection: RedisLifecycleConnection; error: Error; type: "disconnected"; }
connection ​
readonlyconnection:RedisLifecycleConnection
error ​
readonlyerror:Error
type ​
readonlytype:"disconnected"
A connection that had been ready was lost; the client retries on its own. Once per loss, however many attempts fail. Not delivered for the adapter's own close.
Type Literal ​
{ attempt: number; connection: RedisLifecycleConnection; delay: number; error: Error; type: "reconnecting"; }
attempt ​
readonlyattempt:number
connection ​
readonlyconnection:RedisLifecycleConnection
delay ​
readonlydelay:number
error ​
readonlyerror:Error
type ​
readonlytype:"reconnecting"
The client scheduled a reconnect attempt after delay milliseconds; attempt counts them since the loss.
Type Literal ​
{ connection: RedisLifecycleConnection; error: Error; type: "reconnect-failed"; }
connection ​
readonlyconnection:RedisLifecycleConnection
error ​
readonlyerror:Error
type ​
readonlytype:"reconnect-failed"
Terminal: the client ended without the adapter closing it (a retry strategy that returned no delay).
Type Literal ​
{ callback: string; error: Error; event: string; type: "lifecycle-error"; }
callback ​
readonlycallback:string
error ​
readonlyerror:Error
event ​
readonlyevent:string
type ​
readonlytype:"lifecycle-error"
A lifecycle callback threw or returned a rejected promise.