Skip to content

Semantics of get() on cache miss #13

@jsor

Description

@jsor

Currently, get() returns a rejected promise on a cache miss. Since rejection is the asynchronous equivalent of throwing an exception in synchronous code, it behaves like

public function get($key)
{
    if (!isset($this->data[$key])) {
        throw new \Exception()
    }

    return $this->data[$key];
}

Is this the intended behavior?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions