TaskQueueInterface.php 450 B

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