改名
This commit is contained in:
+8
-6
@@ -108,18 +108,20 @@ class Producer extends Component
|
|||||||
$rk->poll($timeout);
|
$rk->poll($timeout);
|
||||||
|
|
||||||
$event = Snowflake::app()->getEvent();
|
$event = Snowflake::app()->getEvent();
|
||||||
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'onFlush'], [$rk, $timeout]);
|
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'onFlush']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $rk
|
* @throws NotFindClassException
|
||||||
* @param $timeout
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
public function onFlush($rk, $timeout)
|
public function onFlush()
|
||||||
{
|
{
|
||||||
var_dump(func_get_args());
|
/** @var \RdKafka\Producer $rk */
|
||||||
|
$rk = Snowflake::getDi()->get(\RdKafka\Producer::class);
|
||||||
|
|
||||||
$this->debug(Event::EVENT_AFTER_REQUEST);
|
$this->debug(Event::EVENT_AFTER_REQUEST);
|
||||||
$rk->flush($timeout);
|
$rk->flush(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user