public class RedisStateMachine extends Object
| Constructor and Description |
|---|
RedisStateMachine()
Initialize a new instance.
|
| 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,
RedisCommand<?,?,?> command,
CommandOutput<?,?,?> output)
Attempt to decode a redis response and return a flag indicating whether a complete response was read.
|
void |
reset()
Reset the state machine.
|
protected void |
safeMulti(CommandOutput<?,?,?> output,
int count,
RedisCommand<?,?,?> command)
Safely sets
CommandOutput.multi(int). |
protected void |
safeSet(CommandOutput<?,?,?> output,
ByteBuffer bytes,
RedisCommand<?,?,?> command)
Safely sets
CommandOutput.set(ByteBuffer). |
protected void |
safeSet(CommandOutput<?,?,?> output,
long integer,
RedisCommand<?,?,?> command)
Safely sets
CommandOutput.set(long). |
protected void |
safeSetError(CommandOutput<?,?,?> output,
ByteBuffer bytes,
RedisCommand<?,?,?> command)
Safely sets
CommandOutput.setError(ByteBuffer). |
protected void |
safeSetSingle(CommandOutput<?,?,?> output,
ByteBuffer bytes,
RedisCommand<?,?,?> command)
Safely sets
CommandOutput.set(ByteBuffer). |
public boolean decode(ByteBuf buffer, CommandOutput<?,?,?> output)
buffer - Buffer containing data from the server.output - Current command output.public boolean decode(ByteBuf buffer, RedisCommand<?,?,?> command, CommandOutput<?,?,?> output)
buffer - Buffer containing data from the server.command - the command itselfoutput - Current command output.public void reset()
public void close()
protected void safeSet(CommandOutput<?,?,?> output, long integer, RedisCommand<?,?,?> command)
CommandOutput.set(long). Completes a command exceptionally in case an exception occurs.output - integer - command - protected void safeSet(CommandOutput<?,?,?> output, ByteBuffer bytes, RedisCommand<?,?,?> command)
CommandOutput.set(ByteBuffer). Completes a command exceptionally in case an exception occurs.output - bytes - command - protected void safeSetSingle(CommandOutput<?,?,?> output, ByteBuffer bytes, RedisCommand<?,?,?> command)
CommandOutput.set(ByteBuffer). Completes a command exceptionally in case an exception occurs.output - bytes - command - protected void safeMulti(CommandOutput<?,?,?> output, int count, RedisCommand<?,?,?> command)
CommandOutput.multi(int). Completes a command exceptionally in case an exception occurs.output - count - command - protected void safeSetError(CommandOutput<?,?,?> output, ByteBuffer bytes, RedisCommand<?,?,?> command)
CommandOutput.setError(ByteBuffer). Completes a command exceptionally in case an exception occurs.output - bytes - command - Copyright © 2019 lettuce.io. All rights reserved.