改名
This commit is contained in:
@@ -106,20 +106,6 @@ class Producer extends Component
|
|||||||
$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);
|
||||||
$rk->poll($timeout);
|
$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);
|
$rk->flush($timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user