改名
This commit is contained in:
+10
-2
@@ -108,9 +108,17 @@ class Producer extends Component
|
|||||||
$rk->poll($timeout);
|
$rk->poll($timeout);
|
||||||
|
|
||||||
$event = Snowflake::app()->getEvent();
|
$event = Snowflake::app()->getEvent();
|
||||||
$event->on(Event::EVENT_AFTER_REQUEST, function () use ($rk, $timeout) {
|
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'onFlush'], [$rk, $timeout]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $rk
|
||||||
|
* @param $timeout
|
||||||
|
*/
|
||||||
|
public function onFlush($rk, $timeout)
|
||||||
|
{
|
||||||
$this->debug(Event::EVENT_AFTER_REQUEST);
|
$this->debug(Event::EVENT_AFTER_REQUEST);
|
||||||
$rk->flush($timeout);
|
$rk->flush($timeout);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user