implicit final class RedisClientEvents extends AnyVal
Redis Client Events
- Alphabetic
- By Inheritance
- RedisClientEvents
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
RedisClientEvents(client: RedisClient)
- client
the given Redis client
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val client: RedisClient
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
onConnect(callback: Function): client.type
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.
- Annotations
- @inline()
-
def
onDrain(callback: Function): client.type
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.
- Annotations
- @inline()
-
def
onEnd(callback: Function): client.type
client will emit end when an established Redis server connection has closed.
client will emit end when an established Redis server connection has closed.
- Annotations
- @inline()
-
def
onError(callback: Function1[RedisError, Any]): client.type
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.
- Annotations
- @inline()
-
def
onIdle(callback: Function): client.type
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.
- Annotations
- @inline()
-
def
onMessage(callback: Function2[RedisChannel, RedisMessage, Any]): client.type
TODO add documentation
TODO add documentation
- Annotations
- @inline()
-
def
onMonitor(callback: Function3[RedisTime, Array[String], Any, Any]): client.type
- Annotations
- @inline()
-
def
onReady(callback: Function): client.type
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.
- Annotations
- @inline()
-
def
onReconnecting(callback: Function): client.type
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.
- Annotations
- @inline()
-
def
onSubscribe(callback: Function2[RedisChannel, RedisCount, Any]): client.type
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()).
- Annotations
- @inline()
-
def
onWarning(callback: Function): client.type
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.
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- Any