Get ConnectionType.REGULAR redis client.
Get connection options.
Get index of the database where ConnectionType.REGULAR connection was established.
⚠ WARNING: Do not change database after ConnectionType.REGULAR connection was established.
Get ConnectionType.PUBLISHER redis client.
Get ConnectionType.SUBSCRIBER redis client.
Connect to Redis server.
Which connections needs to be opened.
At least ConnectionType.REGULAR connection needs to be specified.
Initialization options. These options are available for all established connections.
Disconnect from Redis server.
Closes all of the earlier established connections.
Whether to perform graceful disconnect.
Attach listener
for event
on connectionType
.
This method is made because application modules tend to register listeners before connections are established.
Connection is made from the client constructor, meaning that on listeners registering clients are not created yet.
Therefore, listeners are queued before connections are established, and then registered.
In case connection is established already, they will be registered on it and skip the queueing phase.
Connection on which listener
needs to be registered.
Event name.
Event listener.
Attach listener
for event
on connectionType
.
This method is made because application modules tend to register listeners before connections are established.
Connection is made from the client constructor, meaning that on listeners registering clients are not created yet.
Therefore, listeners are queued before connections are established, and then registered.
In case connection is established already, they will be registered on it and skip the queueing phase.
Connection on which listener
needs to be registered.
Event name.
Event listener.
Attach listener
for event
on connectionType
.
This method is made because application modules tend to register listeners before connections are established.
Connection is made from the client constructor, meaning that on listeners registering clients are not created yet.
Therefore, listeners are queued before connections are established, and then registered.
In case connection is established already, they will be registered on it and skip the queueing phase.
Connection on which listener
needs to be registered.
Event name.
Event listener.
Attach listener
for event
on connectionType
.
This method is made because application modules tend to register listeners before connections are established.
Connection is made from the client constructor, meaning that on listeners registering clients are not created yet.
Therefore, listeners are queued before connections are established, and then registered.
In case connection is established already, they will be registered on it and skip the queueing phase.
Connection on which listener
needs to be registered.
Event name.
Event listener.
Redis client which wraps node_redis client and handles:
- connection
- disconnection
- event listeners
- logging