1 Star 0 Fork 0

Leiow/workerman

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
client.php 708 Bytes
一键复制 编辑 原始数据 按行查看 历史
Leiow 提交于 2017-11-13 23:48 +08:00 . * 完成 Tcp 、消息队列的示例;
<?php
require 'vendor/autoload.php';
use Workerman\Worker;
use Workerman\Connection\AsyncTcpConnection;
use Workerman\Timer;
$worker_path = realpath(__DIR__);
if (file_exists($worker_path . '/config/config.json')) {
$config = json_decode(file_get_contents($worker_path . '/config/config.json'), true);
} else {
exit('Can not find the configuration file!');
}
function record(\Workerman\Worker $worker, $msg)
{
if (Worker::$daemonize) {
Libs\Record::log($worker, $msg);
} else {
echo $msg, PHP_EOL;
}
}
foreach ($config['worker'] as $name => $info) {
if ($info['process'] >= 1) {
require realpath(__DIR__) . "/worker/{$name}.php";
}
}
Worker::runAll();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/Leiow/workerman.git
[email protected]:Leiow/workerman.git
Leiow
workerman
workerman
master

搜索帮助