This commit is contained in:
2025-07-11 11:50:54 +08:00
parent 251e05dbf7
commit c767a1745a
5 changed files with 97 additions and 22 deletions
+21 -8
View File
@@ -7,11 +7,24 @@ interface TaskInterface
/**
* @param array $tasks
* @param float $timeout
* @return false|array
* @param OnTaskInterface $handler
* @param mixed $data
* @param int $dstWorkerId
* @param callable|null $finishFinishCallback
* @return void
*/
public function taskWaitMulti(array $tasks, float $timeout = 0.5): false|array;
public function task(OnTaskInterface $handler, mixed $data, int $dstWorkerId = -1, ?callable $finishFinishCallback = null): void;
/**
* @param OnTaskInterface $handler
* @param mixed $data
* @param float $timeout
* @param int $dstWorkerId
* @return mixed
*/
public function taskWait(OnTaskInterface $handler, mixed $data, float $timeout = 0.5, int $dstWorkerId = -1): mixed;
/**
* @param array $tasks
@@ -20,12 +33,12 @@ interface TaskInterface
*/
public function taskCo(array $tasks, float $timeout = 0.5): false|array;
/**
* @param mixed $data
* @param array $tasks
* @param float $timeout
* @param int $dstWorkerId
* @return mixed
* @return false|array
*/
public function taskWait(mixed $data, float $timeout = 0.5, int $dstWorkerId = -1): mixed;
public function taskWaitMulti(array $tasks, float $timeout = 0.5): false|array;
}