Comments (5)
@a6965921 代码贴一下,说明一下上下文,贴个截图啥的说明一下
from mix.
跟mixphp代码没关系 任何代码都一样 是运行代码前的延迟 应该跟swoole有关系 我先去测试下swoole是不是也有这个问题
from mix.
PHP curl 请求 必须是ip 和 post 才会有延迟
public function submitinforecordzjlist()
{
$info = $this->httprepair('http://ip:9501/', array('openid' => 2133), 'post');
print_r($info);
exit();
}
public function curl_post($url, $data = array())
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
// POST数据
curl_setopt($ch, CURLOPT_POST, 1);
// 把post的变量加上
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
mixphp
*/ class IndexController { /** * Index * @param ServerRequest $request * @param Response $response * @return Response */ /** * @var Database */ public $db; public $dd; public function __construct() { $this->db=context()->get('database'); $this->dd=3; } public function index(ServerRequest $request, Response $response) { $content=$this->dd; return ResponseHelper::html($response, $content); } } 收到数据大概1秒后收到 其实代码运行时间是2.3毫秒 我测试过swoole没有这个问题from mix.
看不明白,完全没明白你测试的是啥
from mix.
如果是请求会超过 1s ,我这里都是正常的,你检查下你环境的原因吧,无法复现。
from mix.
Related Issues (20)
- Redis-subscribe 支持 prefix 否? HOT 1
- 没有对mysql保留关键字做反引号处理 HOT 1
- 2.2版本 UDP服务器会重复执行处理接收到的数据 HOT 2
- 官网无法访问 HOT 2
- 数据量较多时,json_decode可能会失败 HOT 7
- PDO执行使用问号占位符的原生SQL报错 HOT 2
- 建议项目遵从语义化版本来维护版本号 HOT 1
- 新版本性能严重下降 HOT 6
- table方法传入表名order报错 HOT 1
- 验证器场景设置optional未生效 HOT 3
- Coroutine中同时使用Channel和Database pool导致出错 HOT 5
- mix-skeleton使用context()->get('guzzle') 报错 HOT 1
- php8RC3-swoole4.5.6 运行出错 HOT 1
- or and 查找抛出异常 HOT 1
- Upgrade to Zipkin 2.0 HOT 1
- log组件报错 HOT 1
- 推送模式卡死 HOT 1
- 如何正确的提交 PR
- V3 启动事务后 lastInsertId 值不正确 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mix.