改名
This commit is contained in:
+3
-2
@@ -96,8 +96,9 @@ class Producer extends Component
|
|||||||
$event = Snowflake::app()->getEvent();
|
$event = Snowflake::app()->getEvent();
|
||||||
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'flush']);
|
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'flush']);
|
||||||
|
|
||||||
/** @var \RdKafka\Producer $rk */
|
if (!$this->producer) {
|
||||||
$this->producer = Snowflake::createObject(\RdKafka\Producer::class, [$this->conf]);
|
$this->producer = Snowflake::createObject(\RdKafka\Producer::class, [$this->conf]);
|
||||||
|
}
|
||||||
$topic = $this->producer->newTopic($this->_topic, $this->topicConf);
|
$topic = $this->producer->newTopic($this->_topic, $this->topicConf);
|
||||||
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
|
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
|
||||||
$this->producer->poll(0);
|
$this->producer->poll(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user