Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #99 from shellta/master
Browse files Browse the repository at this point in the history
add \Swoole\Server\Task class
  • Loading branch information
wudi committed May 24, 2019
2 parents d03e7e2 + c26269b commit ac02b69
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/Server/Task.php
@@ -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)
{

}
}

0 comments on commit ac02b69

Please sign in to comment.