This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from shellta/master
add \Swoole\Server\Task class
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Swoole\Server; | ||
|
||
|
||
/** | ||
* Class Task | ||
* @package Swoole\Server | ||
* @since 4.2.12 | ||
* @see https://wiki.swoole.com/wiki/page/54.html | ||
* @see https://wiki.swoole.com/wiki/page/1032.html | ||
*/ | ||
class Task | ||
{ | ||
|
||
/** | ||
* @var int 来自哪个Worker进程 | ||
*/ | ||
public $worker_id; | ||
|
||
/** | ||
* @var int 任务的编号 | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @var int 任务的类型 taskwait, task, taskCo, taskWaitMulti 可能使用不同的 flags | ||
*/ | ||
public $flags; | ||
|
||
/** | ||
* @var mixed 任务的数据 | ||
*/ | ||
public $data; | ||
|
||
/** | ||
* @param mixed 完成任务,结束并返回数据 | ||
*/ | ||
public function finish($data) | ||
{ | ||
|
||
} | ||
} |