AbstractCreate a new AbstractConnection instance
Name identifier for this connection
Reference to the main ioRedis connection
OptionalioReference to the main ioRedis subscriber connection
OptionallastThe last error emitted by the error event. We set it to null after
the ready event
Name identifier for this connection
Returns status of the main connection
Returns status of the subscriber connection or undefined when there is no subscriber connection
Get the number of commands queued in automatic pipelines. This is not available (and returns 0) until the cluster is connected and slots information have been received.
Subscribe to a given channel to receive Redis pub/sub events. A new subscriber connection will be created/managed automatically.
The channel name to subscribe to
Function to handle received messages
Optionaloptions: PubSubOptions
Optional subscription configuration
Unsubscribe from a channel
The channel name to unsubscribe from
Optionalhandler: PubSubChannelHandler
Optional specific handler to remove
Make redis subscription for a pattern
The pattern to subscribe to
Function to handle received pattern messages
Optionaloptions: PubSubOptions
Optional subscription configuration
Unsubscribe from a given pattern
The pattern to unsubscribe from
Optionalhandler: PubSubPatternHandler
Optional specific handler to remove
Publish the pub/sub message
The channel to publish to
The message to publish
Optional callback for completion
Publish the pub/sub message
The channel to publish to
The message to publish
Define a custom command using LUA script. You can run the registered command using the "runCommand" method.
Arguments for defining the command
Abstract factory implements the shared functionality required by Redis cluster and the normal Redis connections.
Example