Fix chained promises
This commit is contained in:
parent
410d9b0f0c
commit
31081b01cb
1 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
namespace Appwrite\GraphQL\Promises;
|
namespace Appwrite\GraphQL\Promises;
|
||||||
|
|
||||||
use GraphQL\Error\InvariantViolation;
|
use GraphQL\Error\InvariantViolation;
|
||||||
|
use GraphQL\Executor\Promise\Promise;
|
||||||
use GraphQL\Utils\Utils;
|
use GraphQL\Utils\Utils;
|
||||||
use Swoole\Coroutine\Channel;
|
use Swoole\Coroutine\Channel;
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ class CoroutinePromise
|
||||||
usleep(25000);
|
usleep(25000);
|
||||||
}
|
}
|
||||||
$callable = $this->isFulfilled() ? $onFulfilled : $onRejected;
|
$callable = $this->isFulfilled() ? $onFulfilled : $onRejected;
|
||||||
if (!is_callable($callable)) {
|
if (!\is_callable($callable)) {
|
||||||
$resolve($this->result);
|
$resolve($this->result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -178,7 +179,7 @@ class CoroutinePromise
|
||||||
*/
|
*/
|
||||||
private function setResult(mixed $value): void
|
private function setResult(mixed $value): void
|
||||||
{
|
{
|
||||||
if (!$value instanceof CoroutinePromise) {
|
if (!$value instanceof Promise) {
|
||||||
$this->result = $value;
|
$this->result = $value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue