Package io.lettuce.core.api.async
Interface BaseRedisAsyncCommands<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
- All Known Subinterfaces:
RedisAdvancedClusterAsyncCommands<K,V>
,RedisAsyncCommands<K,V>
,RedisClusterAsyncCommands<K,V>
,RedisClusterPubSubAsyncCommands<K,V>
,RedisPubSubAsyncCommands<K,V>
- All Known Implementing Classes:
AbstractRedisAsyncCommands
,RedisAdvancedClusterAsyncCommandsImpl
,RedisAsyncCommandsImpl
,RedisClusterPubSubAsyncCommandsImpl
,RedisPubSubAsyncCommandsImpl
public interface BaseRedisAsyncCommands<K,V>
Asynchronous executed commands for basic commands.- Since:
- 4.0
- Author:
- Mark Paluch
- Generated class:
- by io.lettuce.apigenerator.CreateAsyncApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T> RedisFuture<T>
dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output)
Dispatch a command to the Redis Server.<T> RedisFuture<T>
dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output, CommandArgs<K,V> args)
Dispatch a command to the Redis Server.RedisFuture<V>
echo(V msg)
Echo the given string.void
flushCommands()
Deprecated.since 6.2.boolean
isOpen()
Deprecated.since 6.2.RedisFuture<String>
ping()
Ping the server.RedisFuture<Long>
publish(K channel, V message)
Post a message to a channel.RedisFuture<List<K>>
pubsubChannels()
Lists the currently *active channels*.RedisFuture<List<K>>
pubsubChannels(K channel)
Lists the currently *active channels*.RedisFuture<Long>
pubsubNumpat()
Returns the number of subscriptions to patterns.RedisFuture<Map<K,Long>>
pubsubNumsub(K... channels)
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.RedisFuture<String>
quit()
Instructs Redis to disconnect the connection.RedisFuture<String>
readOnly()
Switch connection to Read-Only mode when connecting to a cluster.RedisFuture<String>
readWrite()
Switch connection to Read-Write mode (default) when connecting to a cluster.void
reset()
Deprecated.since 6.2.RedisFuture<List<Object>>
role()
Return the role of the instance in the context of replication.void
setAutoFlushCommands(boolean autoFlush)
Deprecated.since 6.2.RedisFuture<Long>
waitForReplication(int replicas, long timeout)
Wait for replication.
-
-
-
Method Detail
-
publish
RedisFuture<Long> publish(K channel, V message)
Post a message to a channel.- Parameters:
channel
- the channel type: key.message
- the message type: value.- Returns:
- Long integer-reply the number of clients that received the message.
-
pubsubChannels
RedisFuture<List<K>> pubsubChannels()
Lists the currently *active channels*.- Returns:
- List<K> array-reply a list of active channels, optionally matching the specified pattern.
-
pubsubChannels
RedisFuture<List<K>> pubsubChannels(K channel)
Lists the currently *active channels*.- Parameters:
channel
- the key.- Returns:
- List<K> array-reply a list of active channels, optionally matching the specified pattern.
-
pubsubNumsub
RedisFuture<Map<K,Long>> pubsubNumsub(K... channels)
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.- Parameters:
channels
- channel keys.- Returns:
- array-reply a list of channels and number of subscribers for every channel.
-
pubsubNumpat
RedisFuture<Long> pubsubNumpat()
Returns the number of subscriptions to patterns.- Returns:
- Long integer-reply the number of patterns all the clients are subscribed to.
-
echo
RedisFuture<V> echo(V msg)
Echo the given string.- Parameters:
msg
- the message type: value.- Returns:
- V bulk-string-reply.
-
role
RedisFuture<List<Object>> role()
Return the role of the instance in the context of replication.- Returns:
- List<Object> array-reply where the first element is one of master, slave, sentinel and the additional elements are role-specific.
-
ping
RedisFuture<String> ping()
Ping the server.- Returns:
- String simple-string-reply.
-
readOnly
RedisFuture<String> readOnly()
Switch connection to Read-Only mode when connecting to a cluster.- Returns:
- String simple-string-reply.
-
readWrite
RedisFuture<String> readWrite()
Switch connection to Read-Write mode (default) when connecting to a cluster.- Returns:
- String simple-string-reply.
-
quit
RedisFuture<String> quit()
Instructs Redis to disconnect the connection. Note that if auto-reconnect is enabled then Lettuce will auto-reconnect if the connection was disconnected. UseStatefulConnection.close()
to close connections and release resources.- Returns:
- String simple-string-reply always OK.
-
waitForReplication
RedisFuture<Long> waitForReplication(int replicas, long timeout)
Wait for replication.- Parameters:
replicas
- minimum number of replicas.timeout
- timeout in milliseconds.- Returns:
- number of replicas.
-
dispatch
<T> RedisFuture<T> dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output)
Dispatch a command to the Redis Server. Please note the command output type must fit to the command response.- Type Parameters:
T
- response type.- Parameters:
type
- the command, must not benull
.output
- the command output, must not benull
.- Returns:
- the command response.
-
dispatch
<T> RedisFuture<T> dispatch(ProtocolKeyword type, CommandOutput<K,V,T> output, CommandArgs<K,V> args)
Dispatch a command to the Redis Server. Please note the command output type must fit to the command response.- Type Parameters:
T
- response type.- Parameters:
type
- the command, must not benull
.output
- the command output, must not benull
.args
- the command arguments, must not benull
.- Returns:
- the command response.
-
isOpen
@Deprecated boolean isOpen()
Deprecated.since 6.2. Use the correspondingStatefulConnection.isOpen()
method on the connection interface. To be removed with Lettuce 7.0.- Returns:
true
if the connection is open (connected and not closed).
-
reset
@Deprecated void reset()
Deprecated.since 6.2. Use the correspondingStatefulConnection.reset()
method on the connection interface. To be removed with Lettuce 7.0.Reset the command state. Queued commands will be canceled and the internal state will be reset. This is useful when the internal state machine gets out of sync with the connection.
-
setAutoFlushCommands
@Deprecated void setAutoFlushCommands(boolean autoFlush)
Deprecated.since 6.2. Use the correspondingStatefulConnection.setAutoFlushCommands(boolean)
method on the connection interface. To be removed with Lettuce 7.0.Disable or enable auto-flush behavior. Default istrue
. If autoFlushCommands is disabled, multiple commands can be issued without writing them actually to the transport. Commands are buffered until aflushCommands()
is issued. After callingflushCommands()
commands are sent to the transport and executed by Redis.- Parameters:
autoFlush
- state of autoFlush.
-
flushCommands
@Deprecated void flushCommands()
Deprecated.since 6.2. Use the correspondingStatefulConnection.flushCommands()
method on the connection interface. To be removed with Lettuce 7.0.Flush pending commands. This commands forces a flush on the channel and can be used to buffer ("pipeline") commands to achieve batching. No-op if channel is not connected.
-
-