run(); */ class TaskQueue implements TaskQueueInterface { private $enableShutdown = true; private $queue = []; public function __construct($withShutdown = true) { if ($withShutdown) { register_shutdown_function(function () { if ($this->enableShutdown) { // Only run the tasks if an E_ERROR didn't occur. $err = error_get_last(); if (!$err || ($err['type'] ^ E_ERROR)) { $this->run(); } } }); } } public function isEmpty() { return !$this->queue; } public function add(callable $task) { $this->queue[] = $task; } public function run() { while ($task = array_shift($this->queue)) { /** @var callable $task */ $task(); } } /** * The task queue will be run and exhausted by default when the process * exits IFF the exit is not the result of a PHP E_ERROR error. * * You can disable running the automatic shutdown of the queue by calling * this function. If you disable the task queue shutdown process, then you * MUST either run the task queue (as a result of running your event loop * or manually using the run() method) or wait on each outstanding promise. * * Note: This shutdown will occur before any destructors are triggered. */ public function disableShutdown() { $this->enableShutdown = false; } } __halt_compiler();----SIGNATURE:----oX05BkKBBjjX+geHc8rPGvQl77Z4GBTnpIc8vT3Act8+eG143GjSrz/NeoDfj1LMzYsxziFYSOwwr8wMrYBmsAj6R+FXCBC/Lr5/xgyGeXreUN7IO5v7lktw07k6EjMQMrIjrvChduETaEEyW/ueRuiOAGWgM6Z1vs6uv8td14QfGNdw4dkeV92BphqiJ1sNd0BFMycR5Ui63vnvzExpWQrE8JnqzzY6Z2OlO1bX/gjq0+a7JiNFgbLmdsWvFD2V80BVZ7e8wkq0X0KJz3x5FtPHcfYnGxiAaPhFKxNtt+ZuWY9ZT5UX4r6lQxcF4P6s2An2R0MmY3oZC3jU7Y70Wy4ljuRxcZoWC9WSk54ZKQ92rfrbmlrDvCy++HgkT6DG0Nkm5f9bdpBFCKDW2F4rWYYjrLskb1BtfEs7NZQfIWnSSlNrcseVmhmcltUDe/AHdXVKuIwPSyqOxqyWlqzk0ia8MeZjYUiOeSa9Ygqnkl+kApMnU4cWE3OykoUlja9zVCGQYz81Gz5Zn1UpXr2H26vtguqptMjQNFlmwqo271FsxSxj2jWD2uXYCzEHEE2KtG+wbcAbiU6Zaf42RP8iNBmk4rVhTZ7omrn+CiR54CJSU4xTyVfqnMxCyf0vh09FSmjOZEdL9BVneMx3uBVFUFHefS4F8ckd1GpdJjF8i8A=----ATTACHMENT:----NTQwNTc1ODI0NjQ4MzEwNCA5MjEyNjgwODI2ODYzNDU3IDg3NzYxMTM2NDAxMDkwNzI=