You are here

public function TaskQueue::__construct in Lockr 7.3

File

vendor/guzzlehttp/promises/src/TaskQueue.php, line 18

Class

TaskQueue
A task queue that executes tasks in a FIFO order.

Namespace

GuzzleHttp\Promise

Code

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