WyriHaximus · GitHub

Conversation

@WyriHaximus

Closed

@WyriHaximus WyriHaximus changed the title [WIP] Failing get should resolve with null Failing get should resolve with null

Feb 5, 2018

clue

[promises](https://github.com/reactphp/promise).

If the key `foo` does not exist, the promise will be rejected.
If the key `foo` does not exist, the promise will be resolve with null as value.

jsor

exist in the cache.
First an attempt is made to retrieve the value of `foo`. A callback function is
registered that will call `getFooFromDb` when the resulting value is null.
`getFooFromDb` is afunction (can be any PHP callable) that will be called if the

jsor

->then(null, array($this, 'getAndCacheFooFromDb'))
->then(function ($result) {
if ($result === null) {
return $this->getFooFromDb();

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

Feb 7, 2018

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

Feb 7, 2018

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

Feb 7, 2018

jsor

jsor approved these changes Feb 7, 2018

clue

[promises](https://github.com/reactphp/promise).

If the key `foo` does not exist, the promise will be rejected.
If the key `foo` does not exist, the promise will fullfill with `null` as value.

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

Feb 10, 2018

@clue clue changed the title Failing get should resolve with null Cache miss resolves with null value

Feb 15, 2018

clue

clue approved these changes Feb 15, 2018

@WyriHaximus

@WyriHaximus

Read the original on github.com ↗