改名
This commit is contained in:
+2
-1
@@ -104,7 +104,6 @@ class Producer extends Component
|
|||||||
if ($rk->getOutQLen() > 0) {
|
if ($rk->getOutQLen() > 0) {
|
||||||
$this->clean($rk, $timeout);
|
$this->clean($rk, $timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic = $rk->newTopic($this->_topic, $this->topicConf);
|
$topic = $rk->newTopic($this->_topic, $this->topicConf);
|
||||||
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
|
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
|
||||||
$this->clean($rk, $timeout);
|
$this->clean($rk, $timeout);
|
||||||
@@ -117,7 +116,9 @@ class Producer extends Component
|
|||||||
*/
|
*/
|
||||||
private function clean($rk, $timeout)
|
private function clean($rk, $timeout)
|
||||||
{
|
{
|
||||||
|
for ($length = 0; $length < $rk->getOutQLen(); $length++) {
|
||||||
$rk->poll(0);
|
$rk->poll(0);
|
||||||
|
}
|
||||||
$rk->flush($timeout);
|
$rk->flush($timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user