改名
This commit is contained in:
+1
-3
@@ -108,9 +108,7 @@ class Producer extends Component
|
|||||||
$rk = new \RdKafka\Producer();
|
$rk = new \RdKafka\Producer();
|
||||||
$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);
|
||||||
if ($rk->getOutQLen() > 0) {
|
$rk->poll($timeout);
|
||||||
$rk->poll($timeout);
|
|
||||||
}
|
|
||||||
$rk->flush($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
|
* @return \Redis|Redis
|
||||||
* @throws ComponentException
|
* @throws ComponentException
|
||||||
|
|||||||
Reference in New Issue
Block a user