TaskQueueInterface.php 468 B

12345678910111213141516171819202122232425
  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. * @param callable $task
  16. */
  17. public function add(callable $task);
  18. /**
  19. * Execute all of the pending task in the queue.
  20. */
  21. public function run();
  22. }