Adds a value for a given key, if the key doesn't already exist in the cache store.
Adds a value for a given key, if the key doesn't already exist in the cache store.
If the key already exists in the cache, the future returned result will be false and the current value will not be overridden. If the key isn't there already, the value will be set and the future returned result will be true.
The expiry time can be Duration.Inf (infinite duration).
either true, in case the value was set, or false otherwise
Shuts down the cache instance, performs any additional cleanups necessary.
Shuts down the cache instance, performs any additional cleanups necessary.
Compare and set.
Compare and set.
should be None in case the key is not expected, or Some(value) otherwise
can be Duration.Inf (infinite) for not setting an expiration
either true (in case the compare-and-set succeeded) or false otherwise
Atomically decrements the given key by a non-negative integer amount and returns the new value.
Atomically decrements the given key by a non-negative integer amount and returns the new value.
The value is stored as the ASCII decimal representation of a 64-bit unsigned integer.
If the key does not exist and a default is provided, sets the value of the key to the provided default and expiry time.
If the key does not exist and no default is provided, or if the key exists with a value that does not conform to the expected representation, the operation will fail.
If the operation succeeds, it returns the new value of the key.
Note that the default value is always treated as None when using the text protocol.
The expiry time can be Duration.Inf (infinite duration).
Deletes a key from the cache store.
Deletes a key from the cache store.
true if a key was deleted or false if there was nothing there to delete
Fetches a value from the cache store.
Fetches a value from the cache store.
Some(value) in case the key is available, or None otherwise (doesn't throw exception on key missing)
Transforms the given key and returns the old value as an Option[T] (None in case the key wasn't in the cache or Some(value) otherwise).
Transforms the given key and returns the old value as an Option[T] (None in case the key wasn't in the cache or Some(value) otherwise).
The cb callback receives the current value (None in case the key is missing or Some(value) otherwise) and should return the new value to store.
The method retries until the compare-and-set operation succeeds, so the callback should have no side-effects.
This function can be used for atomic incrementers and stuff like that.
the old value
Atomically increments the given key by a non-negative integer amount and returns the new value.
Atomically increments the given key by a non-negative integer amount and returns the new value.
The value is stored as the ASCII decimal representation of a 64-bit unsigned integer.
If the key does not exist and a default is provided, sets the value of the key to the provided default and expiry time.
If the key does not exist and no default is provided, or if the key exists with a value that does not conform to the expected representation, the operation will fail.
If the operation succeeds, it returns the new value of the key.
Note that the default value is always treated as None when using the text protocol.
The expiry time can be Duration.Inf (infinite duration).
Sets a (key, value) in the cache store.
Sets a (key, value) in the cache store.
The expiry time can be Duration.Inf (infinite duration).
Transforms the given key and returns the new value.
Transforms the given key and returns the new value.
The cb callback receives the current value (None in case the key is missing or Some(value) otherwise) and should return the new value to store.
The method retries until the compare-and-set operation succeeds, so the callback should have no side-effects.
This function can be used for atomic incrementers and stuff like that.
the new value
Memcached client implementation based on SpyMemcached.
See the parent trait (Cache) for API docs.