React\Promise\LazyPromise::promise PHP Method

promise() public method

See also: Promise::settle()
public promise ( )
    public function promise()
    {
        if (null === $this->promise) {
            try {
                $this->promise = resolve(call_user_func($this->factory));
            } catch (\Throwable $exception) {
                $this->promise = new RejectedPromise($exception);
            } catch (\Exception $exception) {
                $this->promise = new RejectedPromise($exception);
            }
        }
        return $this->promise;
    }