改名
This commit is contained in:
@@ -68,9 +68,14 @@ class Kafka extends \Snowflake\Process\Process
|
|||||||
$this->channel = new Channel(1000);
|
$this->channel = new Channel(1000);
|
||||||
Coroutine::create(function () {
|
Coroutine::create(function () {
|
||||||
$group = new WaitGroup();
|
$group = new WaitGroup();
|
||||||
|
for ($i = 0; $i < 1000; $i++) {
|
||||||
|
$group->add();
|
||||||
|
go(function () use ($group) {
|
||||||
while ([$topic, $part, $message] = $this->channel->pop()) {
|
while ([$topic, $part, $message] = $this->channel->pop()) {
|
||||||
$this->handlerExecute($group, $topic, $part, $message);
|
$this->handlerExecute($group, $topic, $part, $message);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
$group->wait();
|
$group->wait();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user