Skip to content

Commit

Permalink
add event
Browse files Browse the repository at this point in the history
  • Loading branch information
hsldymq committed Mar 25, 2019
1 parent c6e4f92 commit 49240bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* 可以使用on方法监听以下预定义事件:
* @event start dispatcher启动
*
* @event patrolling 进行一次僵尸进程检查周期
*
* @event processed 一条amqp消息被worker成功处理
* 参数: string $workerID, Dispatcher $master
*
Expand Down Expand Up @@ -177,6 +179,9 @@ public function run()
} catch (\Throwable $e) {
$this->shutdown($e);
}

$this->errorlessEmit('patrolling');

// 补杀僵尸进程
for ($i = 0, $len = count($this->idMap); $i < $len; $i++) {
$pid = pcntl_wait($status, WNOHANG);
Expand Down

0 comments on commit 49240bd

Please sign in to comment.