改名
This commit is contained in:
+1
-3
@@ -108,9 +108,7 @@ class Producer extends Component
|
||||
$rk = new \RdKafka\Producer();
|
||||
$topic = $rk->newTopic($this->_topic, $this->topicConf);
|
||||
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
|
||||
if ($rk->getOutQLen() > 0) {
|
||||
$rk->poll($timeout);
|
||||
}
|
||||
$rk->poll($timeout);
|
||||
$rk->flush($timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,16 @@ abstract class BaseApplication extends Service
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Producer
|
||||
* @throws ComponentException
|
||||
*/
|
||||
public function getKafka()
|
||||
{
|
||||
return $this->get('kafka');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \Redis|Redis
|
||||
* @throws ComponentException
|
||||
|
||||
Reference in New Issue
Block a user