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()));
}
+1
View File
@@ -24,6 +24,7 @@ defined('DB_ERROR_BUSY') or define('DB_ERROR_BUSY', 'The database is busy. Pleas
defined('SELECT_IS_NULL') or define('SELECT_IS_NULL', 'Query data does not exist, please check the relevant conditions.');
defined('PARAMS_IS_NULL') or define('PARAMS_IS_NULL', 'Required items cannot be empty, please add.');
defined('CONTROLLER_PATH') or define('CONTROLLER_PATH', APP_PATH . 'app/Http/Controllers/');
defined('KAFKA_PATH') or define('KAFKA_PATH', APP_PATH . 'app/Kafka/');
defined('RPC_SERVICE_PATH') or define('RPC_SERVICE_PATH', APP_PATH . 'app/Http/Rpc/');
defined('RPC_CLIENT_PATH') or define('RPC_CLIENT_PATH', APP_PATH . 'app/Client/Rpc/');
defined('MODEL_PATH') or define('MODEL_PATH', APP_PATH . 'app/Models/');