Interface RedisConnection
- All Superinterfaces:
ReadStream<Response>, StreamBase
A simple Redis client.
-
Method Summary
Modifier and TypeMethodDescriptionSends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.close()Closes the connection or returns to the pool.endHandler(Handler<Void> endHandler) Set an end handler.exceptionHandler(Handler<Throwable> handler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.Set a data handler.pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.booleanFlag to notify if the pending message queue (commands in transit) is full.resume()Resume reading, and sets the buffer inflowingmode.Send the given command to the redis server or cluster.Methods inherited from interface ReadStream
blockingStream, collect, pipe, pipeTo
-
Method Details
-
exceptionHandler
Set an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<Response>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
handler
Set a data handler. As data is read, the handler will be called with the data.- Specified by:
handlerin interfaceReadStream<Response>- Returns:
- a reference to this, so the API can be used fluently
-
pause
RedisConnection pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.While it's paused, no data will be sent to the data
handler.- Specified by:
pausein interfaceReadStream<Response>- Returns:
- a reference to this, so the API can be used fluently
-
resume
RedisConnection resume()Resume reading, and sets the buffer inflowingmode. If theReadStreamhas been paused, reading will recommence on it.- Specified by:
resumein interfaceReadStream<Response>- Returns:
- a reference to this, so the API can be used fluently
-
fetch
Fetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<Response>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandlerin interfaceReadStream<Response>- Returns:
- a reference to this, so the API can be used fluently
-
send
-
batch
-
close
-
pendingQueueFull
boolean pendingQueueFull()Flag to notify if the pending message queue (commands in transit) is full.When the pending message queue is full and a new send command is issued it will result in a exception to be thrown. Checking this flag before sending can allow the application to wait before sending the next message.
- Returns:
- true is queue is full.
-