|
|
public function set($key, $value)
|
|
|
{
|
|
|
$this->data[$key] = $value;
|
|
|
return new Promise\FulfilledPromise(true);
|
|
|
public function remove($key)
|
|
|
{
|
|
|
unset($this->data[$key]);
|
|
|
return new Promise\FulfilledPromise(true);
|
|
|
* @param string $key
|
|
|
* @param mixed $value
|
|
|
* @return void
|
|
|
* @return PromiseInterface<bool|Exception>
|
|
|
*
|
|
|
* @param string $key
|
|
|
* @return void
|
|
|
* @return PromiseInterface<bool|Exception>
|
|
|
/**
|
|
|
* All methods only reject with an exception when an error occurs on the underlying storage
|
|
|
* layer, for example the connection with Redis dropped and cannot be recovered, or the
|
|
|
* directory on the filesystem used to store cache has the wrong permissions of is full.
|
|
|
* Retrieve an item from the cache, resolves with its value on
|
|
|
* success or null when no item can be found.
|
|
|
* success or null when no item can be found. It will reject with an exception
|
|
|
* on error. (Note that a cache miss isn't an error.)
|
|
|
* All methods only reject with an exception when an error occurs on the underlying storage
|
|
|
* layer, for example the connection with Redis dropped and cannot be recovered, or the
|
|
|
* directory on the filesystem used to store cache has the wrong permissions or is full.
|
|
|
*/
|
|
|
* @param string $key
|
|
|
* @param mixed $value
|
|
|
* @return void
|
|
|
* @return PromiseInterface<bool>
|
|
|
|
|
|
If the key `foo` does not exist, the promise will be fulfilled with `null` as value.
|
|
|
If the key `foo` does not exist, the promise will be fulfilled with `null` as value. On
|
|
|
any error it will reject with an exception.
|
|
|
already exists, it is overridden. No guarantees are made as to when the cache
|
|
|
value is set. If the cache implementation has to go over the network to store
|
|
|
already exists, it is overridden. To provide guarantees as to when the cache
|
|
|
value is set a promise is returned. Which will fulfill with `true` on success or
|