WyriHaximus · GitHub

Conversation

@WyriHaximus

jsor

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>

WyriHaximus added a commit to WyriHaximus-labs/cache that referenced this pull request

Feb 20, 2018

WyriHaximus added a commit to WyriHaximus-labs/cache that referenced this pull request

Feb 20, 2018

jsor

/**
* 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.

WyriHaximus added a commit to WyriHaximus-labs/cache that referenced this pull request

Feb 21, 2018

clue

* 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>

clue


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.

clue

clue approved these changes Mar 25, 2018

jsor

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

WyriHaximus added a commit to WyriHaximus-labs/cache that referenced this pull request

Mar 26, 2018

jsor

jsor approved these changes Mar 26, 2018

Maciej Mroziński and others added 2 commits

March 26, 2018 14:15

@WyriHaximus

@WyriHaximus

Closed

Read the original on github.com ↗