public function done(callable $onFulfilled = null, callable $onRejected = null)
{
queue()->enqueue(function () use($onRejected) {
if (null === $onRejected) {
throw UnhandledRejectionException::resolve($this->reason);
}
$result = $onRejected($this->reason);
if ($result instanceof self) {
throw UnhandledRejectionException::resolve($result->reason);
}
if ($result instanceof ExtendedPromiseInterface) {
$result->done();
}
});
}