This commit is contained in:
as2252258@163.com
2021-04-11 19:15:24 +08:00
parent a940719c13
commit 9353a5fe94
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -13,6 +13,7 @@ use RdKafka\TopicConf;
use Snowflake\Core\Json;
use Snowflake\Snowflake;
use Swoole\Coroutine\Channel;
use Swoole\Coroutine\System;
use Swoole\Process;
use Throwable;
@@ -34,6 +35,12 @@ class Kafka extends \Snowflake\Process\Process
*/
public function onHandler(Process $process): void
{
$content = System::readFile(storage('runtime.php'));
$annotation = Snowflake::app()->getAnnotation();
$annotation->setLoader(unserialize($content));
$annotation->runtime(KAFKA_PATH);
$this->waite(swoole_unserialize($process->read()));
}