This commit is contained in:
2023-08-17 16:56:51 +08:00
parent 8fe0453fe4
commit 8257e675ba
2 changed files with 106 additions and 72 deletions
+20 -6
View File
@@ -6,12 +6,26 @@ interface TaskInterface
{
/**
* @param array $handler
* @param int|null $workerId
* @return void
*/
public function dispatch(array $handler, ?int $workerId = null): void;
/**
* @param array $tasks
* @param float $timeout
* @return false|array
*/
public function taskWaitMulti(array $tasks, float $timeout = 0.5): false|array;
/**
* @param array $tasks
* @param float $timeout
* @return false|array
*/
public function taskCo(array $tasks, float $timeout = 0.5): false|array;
/**
* @param mixed $data
* @param float $timeout
* @param int $dstWorkerId
* @return mixed
*/
public function taskWait(mixed $data, float $timeout = 0.5, int $dstWorkerId = -1): mixed;
}