Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package avsystem
    Definition Classes
    com
  • package commons
    Definition Classes
    avsystem
  • package redis
    Definition Classes
    commons
  • object RedisApi

    Object which contains implementations of various variants of Redis API that this driver provides.

    Object which contains implementations of various variants of Redis API that this driver provides. Each variant implements a set of methods corresponding directly to Redis commands, e.g. get method represents Redis GET command.

    API variants may differ from each other in several independent aspects:

    The most important one is the result type returned by every method corresponding to a Redis command:

    Async and Blocking API variants additionally come in three different "levels", each one exposing different subset of Redis commands. This reflects the fact that not every RedisExecutor (client implementation) supports every command (e.g. you can't execute unkeyed commands using RedisClusterClient).

    • Variants from RedisApi.Keyed include only commands with keys (so that they can be executed on Redis Cluster)
    • Variants from RedisApi.Node include only commands which don't access connection state
    • Variants from RedisApi.Connection include all commands supported by the driver

    Every API variant may also use different types to represent Redis keys, hash keys and values. You can define your own API variants for arbitrary combination of key, hash key and value types as long as there is an instance of RedisDataCodec for every of these types. Also, it is possible to customize Record type which is used primarily for entries in Redis Stream API. Record type requires RedisRecordCodec instance.

    Key, field, value and record types and their serialization typeclass instances are enapsulated by RedisSerialization instances. API variants are then parameterized with them.

    API variants which use only Strings (textual) or only ByteStrings (binary) are already implemented by the driver, e.g. RedisApi.Keyed.Async.StringTyped, RedisApi.Batches.BinaryTyped.

    Note that RedisDataCodec is automatically provided for many simple types and also all types which have a GenCodec. This effectively gives you a complete serialization framework for keys, hash keys and values stored in Redis.

    Note that chosen key, hash key and value types can be adjusted "on the fly" with a convenient syntax. For example, if you need to use some case class as a value type in a single, specific place, you can do it without defining a completely separate API variant. For example:

    case class Person(name: String, birthYear: Int)
    object Person {
      implicit val codec: GenCodec[Person] = GenCodec.materialize[Person]
    }
    
    import scala.concurrent.duration._
    implicit val system: ActorSystem = ActorSystem()
    
    val api = RedisApi.Keyed.Blocking.StringTyped(new RedisClusterClient)
    
    // normally, we're just using String-typed API
    api.set("key", "value")
    
    // but in one specific place, we might want to use Person as the value
    // Person has an instance of GenCodec, so it will be automatically serialized to binary format
    api.valueType[Person].set("binaryDataKey", Person("Fred", 1990))
    Definition Classes
    redis
  • object Keyed extends ExecutedApis

    Entry point for API variants which expose only keyed commands.

    Entry point for API variants which expose only keyed commands.

    Definition Classes
    RedisApi
  • Async
  • BaseAsync
  • BaseBlocking
  • Blocking
  • VariantCompanion

object Async extends VariantCompanion[Async] with Serializable

Definition Classes
KeyedExecutedApis
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Async
  2. Serializable
  3. Serializable
  4. VariantCompanion
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type BinaryTyped = Async[ByteStrings.type]
    Definition Classes
    VariantCompanion
  2. type StringTyped = Async[Strings.type]
    Definition Classes
    VariantCompanion

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def BinaryTyped(exec: RequiredExecutor, config: ExecutionConfig = ExecutionConfig.Default): BinaryTyped
    Definition Classes
    VariantCompanion
  5. def StringTyped(exec: RequiredExecutor, config: ExecutionConfig = ExecutionConfig.Default): StringTyped
    Definition Classes
    VariantCompanion
  6. def apply[S <: RedisSerialization](executor: RequiredExecutor, execConfig: ExecutionConfig = ExecutionConfig.Default)(implicit arg0: ValueOf[S]): Async[S]
    Definition Classes
    VariantCompanion
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Keyed.VariantCompanion[Async]

Inherited from AnyRef

Inherited from Any

Ungrouped