Conversation
Closed
WyriHaximus
changed the title
[WIP] Failing get should resolve with null
Failing get should resolve with null
| [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. |
| 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 |
| ->then(null, array($this, 'getAndCacheFooFromDb')) | ||
| ->then(function ($result) { | ||
| if ($result === null) { | ||
| return $this->getFooFromDb(); |
jsor approved these changes Feb 7, 2018
| [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. |
clue
changed the title
Failing get should resolve with null
Cache miss resolves with null value
clue approved these changes Feb 15, 2018