This commit is contained in:
2020-12-28 18:21:20 +08:00
parent 7073096db5
commit cdbc39010e
3 changed files with 21 additions and 15 deletions
+1 -13
View File
@@ -32,25 +32,13 @@ class Kafka extends \Snowflake\Process\Process
/**
* @param Process $process
* @throws ConfigException
* @throws \Exception
*/
public function onHandler(Process $process)
{
$this->channelListener();
$waite = new WaitGroup();
$kafkaServers = SConfig::get('kafka.servers');
foreach ($kafkaServers as $kafkaServer) {
$waite->add();
go(function () use ($kafkaServer, $waite) {
defer(function () use ($waite) {
$waite->done();
});
$this->waite($kafkaServer);
});
}
$waite->wait();
$this->waite(json_decode($process->read(), true));
}