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;
}