This commit is contained in:
2020-10-10 11:31:23 +08:00
parent bc8905c863
commit bfc507782d
+2
View File
@@ -63,6 +63,7 @@ class Kafka extends \Snowflake\Process\Process
*/ */
public function initCoroutine() public function initCoroutine()
{ {
go(function () {
$group = new WaitGroup(); $group = new WaitGroup();
while ([$topic, $part, $message] = $this->channel->pop()) { while ([$topic, $part, $message] = $this->channel->pop()) {
try { try {
@@ -86,6 +87,7 @@ class Kafka extends \Snowflake\Process\Process
} }
} }
$group->wait(); $group->wait();
});
} }