Ai
1 Star 0 Fork 0

清茶/zerosw

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
EasySwooleEvent.php 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
清茶 提交于 2022-08-11 00:06 +08:00 . websocket
<?php
namespace EasySwoole\EasySwoole;
use EasySwoole\EasySwoole\AbstractInterface\Event;
use EasySwoole\EasySwoole\Swoole\EventRegister;
use EasySwoole\Redis\Config\RedisConfig;
use EasySwoole\RedisPool\Pool;
use App\RpcServices\NodeManager\RedisManager;
use EasySwoole\Queue\Job;
use EasySwoole\Component\Timer;
class EasySwooleEvent implements Event
{
public static function initialize()
{
date_default_timezone_set('Asia/Shanghai');
// 初始化mysql
initMysql();
// 初始化redis
initRedis();
}
public static function mainServerCreate(EventRegister $register)
{
$register->add($register::onWorkerStart,function (){
// 链接预热
\EasySwoole\ORM\DbManager::getInstance()->getConnection()->__getClientPool()->keepMin();
});
// 初始化rpc 注册发现 如时用:redis就填写 否则用 myRpc swoole/table注册发现
initRpc();
//初始化queue
initQueue();
// WebSocket
initWs($register);
// 热更新
initHotReload();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/phpallcode_admin/zerosw.git
git@gitee.com:phpallcode_admin/zerosw.git
phpallcode_admin
zerosw
zerosw
master

搜索帮助