| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class SwooleTask |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The swoole http server instace. |
||
| 12 | * |
||
| 13 | * @var \Swoole\Http\Server |
||
| 14 | */ |
||
| 15 | protected $server; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Task constructor |
||
| 19 | */ |
||
| 20 | public function __construct($server) |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Swoole Async task |
||
| 27 | * |
||
| 28 | * @param object $task |
||
| 29 | * @param mixed $callback |
||
| 30 | * @param int $taskWorkerId |
||
| 31 | * |
||
| 32 | * @return mixed |
||
| 33 | */ |
||
| 34 | public function async(callable $task, callable $callback = null, $taskWorkerId = 1) |
||
| 41 |