the given Redis client
the given Redis client
client will emit connect as soon as the stream is connected to the server.
client will emit connect as soon as the stream is connected to the server.
client will emit drain when the TCP connection to the Redis server has been buffering, but is now writable.
client will emit drain when the TCP connection to the Redis server has been buffering, but is now writable. This event can be used to stream commands in to Redis and adapt to backpressure.
If the stream is buffering client.should_buffer is set to true. Otherwise the variable is always set to false. That way you can decide when to reduce your send rate and resume sending commands when you get drain.
You can also check the return value of each command as it will also return the backpressure indicator (deprecated). If false is returned the stream had to buffer.
client will emit end when an established Redis server connection has closed.
client will emit end when an established Redis server connection has closed.
client will emit error when encountering an error connecting to the Redis server or when any other in node_redis occurs.
client will emit error when encountering an error connecting to the Redis server or when any other in node_redis occurs. If you use a command without callback and encounter a ReplyError it is going to be emitted to the error listener.
So please attach the error listener to node_redis.
client will emit idle when there are no outstanding commands that are awaiting a response.
client will emit idle when there are no outstanding commands that are awaiting a response.
TODO add documentation
TODO add documentation
client will emit ready once a connection is established.
client will emit ready once a connection is established. Commands issued before the ready event are queued, then replayed just before this event is emitted.
client will emit reconnecting when trying to reconnect to the Redis server after losing the connection.
client will emit reconnecting when trying to reconnect to the Redis server after losing the connection. Listeners are passed an object containing delay (in ms) and attempt (the attempt #) attributes.
When a client issues a SUBSCRIBE or PSUBSCRIBE, that connection is put into a "subscriber" mode.
When a client issues a SUBSCRIBE or PSUBSCRIBE, that connection is put into a "subscriber" mode. At that point, only commands that modify the subscription set are valid and quit (and depending on the redis version ping as well). When the subscription set is empty, the connection is put back into regular mode.
If you need to send regular commands to Redis while in subscriber mode, just open another connection with a new client (hint: use client.duplicate()).
client will emit warning when password was set but none is needed and if a deprecated option / function / similar is used.
client will emit warning when password was set but none is needed and if a deprecated option / function / similar is used.
Redis Client Events