Class

play.api.cache.redis

AsyncRedis

Related Doc: package redis

Permalink

class AsyncRedis extends RedisCache[Future] with CacheAsyncApi

Annotations
@Singleton()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncRedis
  2. CacheAsyncApi
  3. RedisCache
  4. Implicits
  5. InternalCacheApi
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncRedis(redis: RedisConnector, settings: ConnectionSettings)

    Permalink
    Annotations
    @Inject()

Type Members

  1. implicit class RichFuture[T] extends AnyRef

    Permalink

    enriches any ref by toFuture converting a value to Future.successful

    enriches any ref by toFuture converting a value to Future.successful

    Attributes
    protected
    Definition Classes
    Implicits
  2. implicit class Synchronizer[T] extends AnyRef

    Permalink

    waits for future responses and returns them synchronously

    waits for future responses and returns them synchronously

    Attributes
    protected
    Definition Classes
    Implicits

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. implicit def build[T, Result[_]](value: Future[T])(implicit builder: ResultBuilder[Result], context: ExecutionContext, timeout: Timeout): Result[T]

    Permalink

    Transforms the promise into desired builder results

    Transforms the promise into desired builder results

    Attributes
    protected
    Definition Classes
    Implicits
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def exists(key: String): Future[Boolean]

    Permalink

    Determines whether value exists in cache.

    Determines whether value exists in cache.

    key

    cache storage key

    returns

    record existence, true if exists, otherwise false

    Definition Classes
    RedisCacheInternalCacheApi
  10. def expire(key: String, expiration: Duration): Future[Unit]

    Permalink

    refreshes expiration time on a given key, useful, e.g., when we want to refresh session duration

    refreshes expiration time on a given key, useful, e.g., when we want to refresh session duration

    key

    cache storage key

    expiration

    new expiration in seconds

    returns

    promise

    Definition Classes
    RedisCacheInternalCacheApi
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def get[T](key: String)(implicit arg0: ClassTag[T]): Future[Option[T]]

    Permalink

    Retrieve a value from the cache.

    Retrieve a value from the cache.

    key

    cache storage key

    returns

    stored record, Some if exists, otherwise None

    Definition Classes
    RedisCacheInternalCacheApi
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getOrElse[T](key: String, expiration: Duration)(orElse: ⇒ T)(implicit arg0: ClassTag[T]): Future[T]

    Permalink

    Retrieve a value from the cache.

    Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.

    key

    cache storage key

    expiration

    expiration period in seconds.

    orElse

    The default function to invoke if the value was not found in cache.

    returns

    stored or default record, Some if exists, otherwise None

    Definition Classes
    RedisCacheInternalCacheApi
  15. def getOrFuture[T](key: String, expiration: Duration)(orElse: ⇒ Future[T])(implicit arg0: ClassTag[T]): Future[T]

    Permalink

    Retrieve a value from the cache.

    Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.

    key

    cache storage key

    expiration

    expiration period in seconds.

    orElse

    The default function to invoke if the value was not found in cache.

    returns

    stored or default record, Some if exists, otherwise None

    Definition Classes
    RedisCacheInternalCacheApi
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. def invalidate(): Future[Unit]

    Permalink

    Remove all keys in cache

    Remove all keys in cache

    returns

    promise

    Definition Classes
    RedisCacheInternalCacheApi
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def matching(pattern: String): Future[Set[String]]

    Permalink

    Retrieves all keys matching the given pattern.

    Retrieves all keys matching the given pattern. This method invokes KEYS command

    Warning: complexity is O(n) where n are all keys in the database

    pattern

    valid KEYS pattern with wildcards

    returns

    list of matching keys

    Definition Classes
    RedisCacheInternalCacheApi
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. def remove(key1: String, key2: String, keys: String*): Future[Unit]

    Permalink

    Remove all values from the cache

    Remove all values from the cache

    key1

    cache storage key

    key2

    cache storage key

    keys

    cache storage keys

    returns

    promise

    Definition Classes
    RedisCacheInternalCacheApi
  24. def remove(key: String): Future[Unit]

    Permalink

    Remove a value under the given key from the cache

    Remove a value under the given key from the cache

    key

    cache storage key

    returns

    promise

    Definition Classes
    RedisCacheInternalCacheApi
  25. def removeAll(keys: String*): Future[Unit]

    Permalink

    Removes all keys in arguments.

    Removes all keys in arguments. The other remove methods are for syntax sugar

    keys

    cache storage keys

    returns

    promise

    Definition Classes
    RedisCacheInternalCacheApi
  26. def removeMatching(pattern: String): Future[Unit]

    Permalink

    Removes all keys matching the given pattern.

    Removes all keys matching the given pattern. This command has no direct support in Redis, it is combination of KEYS and DEL commands.

    • KEYS pattern command finds all keys matching the given pattern
    • DEL keys expires all of them

    This is usable in scenarios when multiple keys contains same part of the key, such as record identification, user identification, etc. For example, we may have keys such as 'page/$id/header', 'page/$id/body', 'page/$id/footer' and we want to remove them all when the page is changed. We use the benefit of the naming convention we use and execute removeAllMatching( s"page/$id/*" ), which invalidates everything related to the given page. The benefit is we do not need to maintain the list of all keys to invalidate, we invalidate them all at once.

    Warning: complexity is O(n) where n are all keys in the database

    pattern

    this must be valid KEYS pattern

    returns

    nothing

    Definition Classes
    RedisCacheInternalCacheApi
  27. def set(key: String, value: Any, expiration: Duration): Future[Unit]

    Permalink

    Set a value into the cache.

    Set a value into the cache. Expiration time in seconds (0 second means eternity).

    key

    cache storage key

    value

    value to store

    expiration

    record duration in seconds

    returns

    promise

    Definition Classes
    RedisCacheInternalCacheApi
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CacheAsyncApi

Inherited from RedisCache[Future]

Inherited from Implicits

Inherited from InternalCacheApi[Future]

Inherited from AnyRef

Inherited from Any

Ungrouped