This commit is contained in:
2020-10-28 16:42:15 +08:00
parent 41b253d172
commit 14c052a3b2
-14
View File
@@ -106,20 +106,6 @@ class Producer extends Component
$topic = $rk->newTopic($this->_topic, $this->topicConf);
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
$rk->poll($timeout);
$event = Snowflake::app()->getEvent();
$event->on(Event::EVENT_AFTER_REQUEST, [$this,'onFlush'], [$rk, $timeout]);
}
/**
* @param $rk
* @param $timeout
*/
public function onFlush($rk, $timeout)
{
var_dump($rk, $timeout);
$this->debug(Event::EVENT_AFTER_REQUEST);
$rk->flush($timeout);
}
}