diff --git a/src/Internal/Queue.php b/src/Internal/Queue.php index 19939881..f8468b53 100644 --- a/src/Internal/Queue.php +++ b/src/Internal/Queue.php @@ -19,19 +19,10 @@ public function enqueue(callable $task): void private function drain(): void { for ($i = \key($this->queue); isset($this->queue[$i]); $i++) { - $task = $this->queue[$i]; - - $exception = null; - try { - $task(); - } catch (\Throwable $exception) { - } - - unset($this->queue[$i]); - - if ($exception) { - throw $exception; + ($this->queue[$i])(); + } finally { + unset($this->queue[$i]); } }