CacheAsyncApi
Asynchronous non-blocking implementation of the connection to the redis database
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Inherited methods
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
If it sets new value, it subsequently calls EXPIRE to set required expiration time
Value parameters
- expiration
-
record duration, applies only when appends to nothing
- key
-
cache storage key
- value
-
value to append
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Decrements the stored string value representing 10-based signed integer by given value.
Decrements the stored string value representing 10-based signed integer by given value.
Value parameters
- by
-
size of decrement
- key
-
cache storage key
Attributes
- Returns
-
the value after the decrement
- Since
-
1.3.0
- Inherited from:
- AbstractCacheApi (hidden)
Determines whether value exists in cache.
Determines whether value exists in cache.
Value parameters
- key
-
cache storage key
Attributes
- Returns
-
record existence, true if exists, otherwise false
- Inherited from:
- AbstractCacheApi (hidden)
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
Value parameters
- expiration
-
new expiration in seconds
- key
-
cache storage key
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Returns the remaining time to live of a key that has an expire set, useful, e.g., when we want to check remaining session duration
Returns the remaining time to live of a key that has an expire set, useful, e.g., when we want to check remaining session duration
Value parameters
- key
-
cache storage key
Attributes
- Returns
-
the remaining time to live of a key. Some finite duration when the value exists and the expiration is set, Some infinite duration when the value exists but never expires, and None when the key does not exist.
- Inherited from:
- AbstractCacheApi (hidden)
Retrieve a value from the cache.
Retrieve a value from the cache.
Value parameters
- key
-
cache storage key
Attributes
- Returns
-
stored record, Some if exists, otherwise None
- Inherited from:
- AbstractCacheApi (hidden)
Retrieve the values of all specified keys from the cache.
Retrieve the values of all specified keys from the cache.
Value parameters
- keys
-
a collection of cache storage keys
Attributes
- Returns
-
stored record, Some if exists, otherwise None
- Inherited from:
- AbstractCacheApi (hidden)
Retrieve the values of all specified keys from the cache.
Retrieve the values of all specified keys from the cache.
Value parameters
- key
-
cache storage keys
Attributes
- Returns
-
stored record, Some if exists, otherwise None
- Inherited from:
- AbstractCacheApi (hidden)
Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.
Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.
Lazy invocation (default): The method does wait for the result of set
and when it fails, it applies the recovery policy.
Eager invocation: The method does not wait for the result of set
if the value is not cached and also does not apply recovery policy if the set
fails.
Value parameters
- expiration
-
expiration period in seconds.
- key
-
cache storage key
- orElse
-
The default function to invoke if the value was not found in cache.
Attributes
- Returns
-
stored or default record, Some if exists, otherwise None
- Inherited from:
- AbstractCacheApi (hidden)
Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.
Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.
Lazy invocation (default): The method does wait for the result of set
and when it fails, it applies the recovery policy.
Eager invocation: The method does not wait for the result of set
if the value is not cached and also does not apply recovery policy if the set
fails.
Value parameters
- expiration
-
expiration period in seconds.
- key
-
cache storage key
- orElse
-
The default function to invoke if the value was not found in cache.
Attributes
- Returns
-
stored or default record, Some if exists, otherwise None
- Inherited from:
- AbstractCacheApi (hidden)
Increments the stored string value representing 10-based signed integer by given value.
Increments the stored string value representing 10-based signed integer by given value.
Value parameters
- by
-
size of increment
- key
-
cache storage key
Attributes
- Returns
-
the value after the increment
- Since
-
1.3.0
- Inherited from:
- AbstractCacheApi (hidden)
Remove all keys in cache
Remove all keys in cache
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Scala wrapper around Redis list-related commands. This simplifies use of the lists.
Scala wrapper around Redis list-related commands. This simplifies use of the lists.
Type parameters
- T
-
type of elements within the list
Value parameters
- key
-
the key storing the list
Attributes
- Returns
-
Scala wrapper
- Inherited from:
- AbstractCacheApi (hidden)
Scala wrapper around Redis hash-related commands. This simplifies use of the hashes, i.e., maps.
Scala wrapper around Redis hash-related commands. This simplifies use of the hashes, i.e., maps.
Type parameters
- T
-
type of elements within the map
Value parameters
- key
-
the key storing the map
Attributes
- Returns
-
Scala wrapper
- Inherited from:
- AbstractCacheApi (hidden)
Retrieves all keys matching the given pattern. This method invokes KEYS command
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
Value parameters
- pattern
-
valid KEYS pattern with wildcards
Attributes
- Returns
-
list of matching keys
- Inherited from:
- AbstractCacheApi (hidden)
Remove all values from the cache
Remove all values from the cache
Value parameters
- key1
-
cache storage key
- key2
-
cache storage key
- keys
-
cache storage keys
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Remove a value under the given key from the cache
Remove a value under the given key from the cache
Value parameters
- key
-
cache storage key
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Removes all keys in arguments. The other remove methods are for syntax sugar
Removes all keys in arguments. The other remove methods are for syntax sugar
Value parameters
- keys
-
cache storage keys
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Removes all keys matching the given pattern. This command has no direct support in Redis, it is combination of KEYS and DEL commands.
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 patternDEL 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
Value parameters
- pattern
-
this must be valid KEYS pattern
Attributes
- Returns
-
nothing
- Inherited from:
- AbstractCacheApi (hidden)
Scala wrapper around Redis set-related commands. This simplifies use of the sets.
Scala wrapper around Redis set-related commands. This simplifies use of the sets.
Type parameters
- T
-
type of elements within the set
Value parameters
- key
-
the key storing the set
Attributes
- Returns
-
Scala wrapper
- Inherited from:
- AbstractCacheApi (hidden)
Set a value into the cache. Expiration time in seconds (0 second means eternity).
Set a value into the cache. Expiration time in seconds (0 second means eternity).
Value parameters
- expiration
-
record duration in seconds
- key
-
cache storage key
- value
-
value to store
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Sets the given keys to their respective values for eternity. If any value is null, the particular key is excluded from the operation and removed from cache instead. The operation is atomic when there are no nulls. It replaces existing values.
Sets the given keys to their respective values for eternity. If any value is null, the particular key is excluded from the operation and removed from cache instead. The operation is atomic when there are no nulls. It replaces existing values.
Value parameters
- keyValues
-
cache storage key-value pairs to store
Attributes
- Returns
-
promise
- Inherited from:
- AbstractCacheApi (hidden)
Sets the given keys to their respective values for eternity. It sets all values if none of them exist, if at least a single of them exists, it does not set any value, thus it is either all or none. If any value is null, the particular key is excluded from the operation and removed from cache instead. The operation is atomic when there are no nulls.
Sets the given keys to their respective values for eternity. It sets all values if none of them exist, if at least a single of them exists, it does not set any value, thus it is either all or none. If any value is null, the particular key is excluded from the operation and removed from cache instead. The operation is atomic when there are no nulls.
Value parameters
- keyValues
-
cache storage key-value pairs to store
Attributes
- Returns
-
true if value was set, false if any value already existed before
- Inherited from:
- AbstractCacheApi (hidden)
Set a value into the cache if the given key is not already used, otherwise do nothing. Expiration time in seconds (0 second means eternity).
Set a value into the cache if the given key is not already used, otherwise do nothing. Expiration time in seconds (0 second means eternity).
Note: When expiration is defined, it is not an atomic operation. Redis does not provide a command for store-if-not-exists with duration. First, it sets the value if exists. Then, if the operation succeeded, it sets its expiration date.
Note: When recovery policy used, it recovers with TRUE to indicate "the lock was acquired" despite actually not storing anything.
Value parameters
- expiration
-
record duration in seconds
- key
-
cache storage key
- value
-
value to store
Attributes
- Returns
-
true if value was set, false if was ignored because it existed before
- Inherited from:
- AbstractCacheApi (hidden)
Scala wrapper around Redis sorted-set-related commands.
Scala wrapper around Redis sorted-set-related commands.
Type parameters
- T
-
type of elements within the sorted-set
Value parameters
- key
-
the key storing the map
Attributes
- Returns
-
Scala wrapper
- Inherited from:
- AbstractCacheApi (hidden)