public class RedisStateMachine extends Object
| Constructor and Description |
|---|
RedisStateMachine()
Initialize a new instance.
|
RedisStateMachine(ByteBufAllocator alloc)
Deprecated.
since 6.3,
no longer required. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the state machine to free resources.
|
boolean |
decode(ByteBuf buffer,
CommandOutput<?,?,?> output)
Decode a command using the input buffer.
|
boolean |
decode(ByteBuf buffer,
CommandOutput<?,?,?> output,
Consumer<Exception> errorHandler)
Attempt to decode a redis response and return a flag indicating whether a complete response was read.
|
ProtocolVersion |
getProtocolVersion() |
boolean |
isDiscoverProtocol() |
void |
reset()
Reset the state machine.
|
protected void |
safeMultiArray(CommandOutput<?,?,?> output,
int count,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.multiArray(int). |
protected void |
safeMultiMap(CommandOutput<?,?,?> output,
int count,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.multiMap(int). |
protected void |
safeMultiPush(CommandOutput<?,?,?> output,
int count,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.multiPush(int). |
protected void |
safeMultiSet(CommandOutput<?,?,?> output,
int count,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.multiSet(int). |
protected void |
safeSet(CommandOutput<?,?,?> output,
boolean value,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.set(boolean). |
protected void |
safeSet(CommandOutput<?,?,?> output,
ByteBuffer bytes,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.set(ByteBuffer). |
protected void |
safeSet(CommandOutput<?,?,?> output,
double number,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.set(double). |
protected void |
safeSet(CommandOutput<?,?,?> output,
long number,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.set(long). |
protected void |
safeSetBigNumber(CommandOutput<?,?,?> output,
ByteBuffer bytes,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.set(ByteBuffer). |
protected void |
safeSetError(CommandOutput<?,?,?> output,
ByteBuffer bytes,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.setError(ByteBuffer). |
protected void |
safeSetSingle(CommandOutput<?,?,?> output,
ByteBuffer bytes,
Consumer<Exception> errorHandler)
Safely sets
CommandOutput.set(ByteBuffer). |
void |
setProtocolVersion(ProtocolVersion protocolVersion) |
@Deprecated public RedisStateMachine(ByteBufAllocator alloc)
no longer required.public RedisStateMachine()
public boolean isDiscoverProtocol()
public ProtocolVersion getProtocolVersion()
public void setProtocolVersion(ProtocolVersion protocolVersion)
public boolean decode(ByteBuf buffer, CommandOutput<?,?,?> output)
buffer - Buffer containing data from the server.output - Current command output.public boolean decode(ByteBuf buffer, CommandOutput<?,?,?> output, Consumer<Exception> errorHandler)
buffer - Buffer containing data from the server.output - Current command output.errorHandler - the error handlerpublic void reset()
public void close()
protected void safeSet(CommandOutput<?,?,?> output, boolean value, Consumer<Exception> errorHandler)
CommandOutput.set(boolean). Completes a errorHandler exceptionally in case an exception occurs.output - value - errorHandler - protected void safeSet(CommandOutput<?,?,?> output, long number, Consumer<Exception> errorHandler)
CommandOutput.set(long). Notifies the errorHandler if an exception occurs.output - number - errorHandler - protected void safeSet(CommandOutput<?,?,?> output, double number, Consumer<Exception> errorHandler)
CommandOutput.set(double). Notifies the errorHandler if an exception occurs.output - number - errorHandler - protected void safeSet(CommandOutput<?,?,?> output, ByteBuffer bytes, Consumer<Exception> errorHandler)
CommandOutput.set(ByteBuffer). Notifies the errorHandler if an exception occurs.output - bytes - errorHandler - protected void safeSetSingle(CommandOutput<?,?,?> output, ByteBuffer bytes, Consumer<Exception> errorHandler)
CommandOutput.set(ByteBuffer). Notifies the errorHandler if an exception occurs.output - bytes - errorHandler - protected void safeSetBigNumber(CommandOutput<?,?,?> output, ByteBuffer bytes, Consumer<Exception> errorHandler)
CommandOutput.set(ByteBuffer). Notifies the errorHandler if an exception occurs.output - bytes - errorHandler - protected void safeMultiArray(CommandOutput<?,?,?> output, int count, Consumer<Exception> errorHandler)
CommandOutput.multiArray(int). Notifies the errorHandler if an exception occurs.output - count - errorHandler - protected void safeMultiPush(CommandOutput<?,?,?> output, int count, Consumer<Exception> errorHandler)
CommandOutput.multiPush(int). Notifies the errorHandler if an exception occurs.output - count - errorHandler - protected void safeMultiSet(CommandOutput<?,?,?> output, int count, Consumer<Exception> errorHandler)
CommandOutput.multiSet(int). Notifies the errorHandler if an exception occurs.output - count - errorHandler - protected void safeMultiMap(CommandOutput<?,?,?> output, int count, Consumer<Exception> errorHandler)
CommandOutput.multiMap(int). Notifies the errorHandler if an exception occurs.output - count - errorHandler - protected void safeSetError(CommandOutput<?,?,?> output, ByteBuffer bytes, Consumer<Exception> errorHandler)
CommandOutput.setError(ByteBuffer). Notifies the errorHandler if an exception occurs.output - bytes - errorHandler - Copyright © 2024 lettuce.io. All rights reserved.