TaskSystem/vendor/guzzlehttp/promises/src/TaskQueueInterface.php

25 lines
450 B
PHP
Raw Normal View History

2023-07-15 10:16:32 +08:00
<?php
2023-08-09 14:43:30 +08:00
declare(strict_types=1);
2023-07-15 10:16:32 +08:00
namespace GuzzleHttp\Promise;
interface TaskQueueInterface
{
/**
* Returns true if the queue is empty.
*/
2023-08-09 14:43:30 +08:00
public function isEmpty(): bool;
2023-07-15 10:16:32 +08:00
/**
* Adds a task to the queue that will be executed the next time run is
* called.
*/
2023-08-09 14:43:30 +08:00
public function add(callable $task): void;
2023-07-15 10:16:32 +08:00
/**
* Execute all of the pending task in the queue.
*/
2023-08-09 14:43:30 +08:00
public function run(): void;
2023-07-15 10:16:32 +08:00
}