modify
This commit is contained in:
@@ -13,6 +13,7 @@ use RdKafka\TopicConf;
|
|||||||
use Snowflake\Core\Json;
|
use Snowflake\Core\Json;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
use Swoole\Coroutine\Channel;
|
use Swoole\Coroutine\Channel;
|
||||||
|
use Swoole\Coroutine\System;
|
||||||
use Swoole\Process;
|
use Swoole\Process;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
@@ -34,6 +35,12 @@ class Kafka extends \Snowflake\Process\Process
|
|||||||
*/
|
*/
|
||||||
public function onHandler(Process $process): void
|
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()));
|
$this->waite(swoole_unserialize($process->read()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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('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('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('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_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('RPC_CLIENT_PATH') or define('RPC_CLIENT_PATH', APP_PATH . 'app/Client/Rpc/');
|
||||||
defined('MODEL_PATH') or define('MODEL_PATH', APP_PATH . 'app/Models/');
|
defined('MODEL_PATH') or define('MODEL_PATH', APP_PATH . 'app/Models/');
|
||||||
|
|||||||
Reference in New Issue
Block a user