Skip to content

Semantics of get() on cache miss #13

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions