Skip to content

Commit

Permalink
feat: alter FooWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Oct 26, 2020
1 parent 863c256 commit d6593cd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/Console/Workers/FooWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Console\Workers;

use Mix\Sync\WaitGroup;
use Mix\WorkerPool\AbstractWorker;
use Swoole\Coroutine\Channel;

/**
* Class FooWorker
Expand All @@ -15,12 +13,9 @@ class FooWorker extends AbstractWorker

/**
* FooWorker constructor.
* @param Channel $workerPool
* @param WaitGroup $waitGroup
*/
public function __construct(Channel $workerPool, WaitGroup $waitGroup)
public function __construct()
{
parent::__construct($workerPool, $waitGroup);
// 实例化一些需重用的对象
// ...
}
Expand All @@ -29,7 +24,7 @@ public function __construct(Channel $workerPool, WaitGroup $waitGroup)
* 处理
* @param $data
*/
public function handle($data)
public function do($data)
{
var_dump($data);
}
Expand Down

0 comments on commit d6593cd

Please sign in to comment.