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.

    For example, if you keep only numeric values on a Redis Cluster installation, you might define an API variant like this one:

    class NumericKeyedAsyncApi(executor: RedisKeyedExecutor, config: ExecutionConfig = ExecutionConfig.Default)
      extends RedisApi.Keyed.Async[String,String,Long](executor, config)

    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
  • Batches
  • Connection
  • Keyed
  • Node
  • Raw

object Node

Entry point for API variants which expose node-level commands, i.e. the ones that don't access or modify Redis connection state.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Node
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class Async[Key, HashKey, Value] extends AbstractRedisApi[Async, Key, HashKey, Value] with RedisRecoverableNodeApi with RedisAsyncApi
  2. class Blocking[Key, HashKey, Value] extends AbstractRedisApi[Blocking, Key, HashKey, Value] with RedisRecoverableNodeApi with RedisBlockingApi

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  20. object Async

    Entry point for API variants which execute commands using RedisNodeExecutor (e.g.

    Entry point for API variants which execute commands using RedisNodeExecutor (e.g. RedisNodeClient) and return results as Futures.

  21. object Blocking

    Entry point for API variants which execute commands using RedisNodeExecutor (e.g.

    Entry point for API variants which execute commands using RedisNodeExecutor (e.g. RedisNodeClient) and return results synchronously.

Inherited from AnyRef

Inherited from Any

Ungrouped