Skip to content

Commit d6593cd

Browse files
committed
feat: alter FooWorker
1 parent 863c256 commit d6593cd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

app/Console/Workers/FooWorker.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace App\Console\Workers;
44

5-
use Mix\Sync\WaitGroup;
65
use Mix\WorkerPool\AbstractWorker;
7-
use Swoole\Coroutine\Channel;
86

97
/**
108
* Class FooWorker
@@ -15,12 +13,9 @@ class FooWorker extends AbstractWorker
1513

1614
/**
1715
* FooWorker constructor.
18-
* @param Channel $workerPool
19-
* @param WaitGroup $waitGroup
2016
*/
21-
public function __construct(Channel $workerPool, WaitGroup $waitGroup)
17+
public function __construct()
2218
{
23-
parent::__construct($workerPool, $waitGroup);
2419
// 实例化一些需重用的对象
2520
// ...
2621
}
@@ -29,7 +24,7 @@ public function __construct(Channel $workerPool, WaitGroup $waitGroup)
2924
* 处理
3025
* @param $data
3126
*/
32-
public function handle($data)
27+
public function do($data)
3328
{
3429
var_dump($data);
3530
}

0 commit comments

Comments
 (0)