TaskQueueInterface.php 433 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace GuzzleHttp\Promise;
  3. interface TaskQueueInterface
  4. {
  5. /**
  6. * Returns true if the queue is empty.
  7. *
  8. * @return bool
  9. */
  10. public function isEmpty();
  11. /**
  12. * Adds a task to the queue that will be executed the next time run is
  13. * called.
  14. */
  15. public function add(callable $task);
  16. /**
  17. * Execute all of the pending task in the queue.
  18. */
  19. public function run();
  20. }