Module lettuce.core

Interface RedisAsyncCommands<K,​V>

Type Parameters:
K - Key type.
V - Value type.
All Superinterfaces:
BaseRedisAsyncCommands<K,​V>, RedisAclAsyncCommands<K,​V>, RedisClusterAsyncCommands<K,​V>, RedisGeoAsyncCommands<K,​V>, RedisHashAsyncCommands<K,​V>, RedisHLLAsyncCommands<K,​V>, RedisKeyAsyncCommands<K,​V>, RedisListAsyncCommands<K,​V>, RedisScriptingAsyncCommands<K,​V>, RedisServerAsyncCommands<K,​V>, RedisSetAsyncCommands<K,​V>, RedisSortedSetAsyncCommands<K,​V>, RedisStreamAsyncCommands<K,​V>, RedisStringAsyncCommands<K,​V>, RedisTransactionalAsyncCommands<K,​V>
All Known Subinterfaces:
RedisClusterPubSubAsyncCommands<K,​V>, RedisPubSubAsyncCommands<K,​V>
All Known Implementing Classes:
RedisAsyncCommandsImpl, RedisClusterPubSubAsyncCommandsImpl, RedisPubSubAsyncCommandsImpl

public interface RedisAsyncCommands<K,​V>
extends BaseRedisAsyncCommands<K,​V>, RedisAclAsyncCommands<K,​V>, RedisClusterAsyncCommands<K,​V>, RedisGeoAsyncCommands<K,​V>, RedisHashAsyncCommands<K,​V>, RedisHLLAsyncCommands<K,​V>, RedisKeyAsyncCommands<K,​V>, RedisListAsyncCommands<K,​V>, RedisScriptingAsyncCommands<K,​V>, RedisServerAsyncCommands<K,​V>, RedisSetAsyncCommands<K,​V>, RedisSortedSetAsyncCommands<K,​V>, RedisStreamAsyncCommands<K,​V>, RedisStringAsyncCommands<K,​V>, RedisTransactionalAsyncCommands<K,​V>
A complete asynchronous and thread-safe Redis API with 400+ Methods.
Since:
3.0
Author:
Mark Paluch
  • Method Details

    • auth

      RedisFuture<String> auth​(CharSequence password)
      Authenticate to the server.
      Specified by:
      auth in interface RedisClusterAsyncCommands<K,​V>
      Parameters:
      password - the password
      Returns:
      String simple-string-reply
    • auth

      RedisFuture<String> auth​(String username, CharSequence password)
      Authenticate to the server with username and password. Requires Redis 6 or newer.
      Specified by:
      auth in interface RedisClusterAsyncCommands<K,​V>
      Parameters:
      username - the username
      password - the password
      Returns:
      String simple-string-reply
      Since:
      6.0
    • select

      RedisFuture<String> select​(int db)
      Change the selected database for the current connection.
      Parameters:
      db - the database number
      Returns:
      String simple-string-reply
    • swapdb

      RedisFuture<String> swapdb​(int db1, int db2)
      Swap two Redis databases, so that immediately all the clients connected to a given DB will see the data of the other DB, and the other way around
      Parameters:
      db1 - the first database number
      db2 - the second database number
      Returns:
      String simple-string-reply
    • getStatefulConnection

      StatefulRedisConnection<K,​V> getStatefulConnection()
      Returns:
      the underlying connection.