Comments (5)
当把连接赋值出来,延后析构,就可以了,这个bug非常奇怪,我在找swoole开发组的人一起看看。
$conn = $db->prepare('select * from users');
$result = $conn->queryAll();
$chan->push($result);
from mix.
当把连接赋值出来,延后析构,就可以了,这个bug非常奇怪,我在找swoole开发组的人一起看看。
$conn = $db->prepare('select * from users'); $result = $conn->queryAll(); $chan->push($result);
试了下确实如此,无论是mysql还是redis都需要将连接赋值出来,不然一但超过8个协程拿到连接就将channel销毁了,修复前只能暂时这样用了,thx~
from mix.
@liushzhql 已经解决了该问题,后面的版本发布 77b27a4 mix-php/mix-skeleton@6c7e6e9
from mix.
@liushzhql 搞定, https://github.com/mix-php/mix/releases/tag/v2.2.12
from mix.
mix-php/mix-skeleton v2.2.12中需要使用构造参数而非属性注入,示例如下:
/mix/manifest/beans/database.php
<?php
return [
// Database
[
// 名称
'name' => 'database',
// 作用域
'scope' => \Mix\Bean\BeanDefinition::SINGLETON,
// 类路径
'class' => \Mix\Database\Database::class,
// 构造函数注入
'constructorArgs' => [
// dsn
getenv('DATABASE_DSN'),
// username
getenv('DATABASE_USERNAME'),
// password
getenv('DATABASE_PASSWORD'),
// options: http://php.net/manual/zh/pdo.setattribute.php
[
// 设置默认的提取模式: \PDO::FETCH_OBJ | \PDO::FETCH_ASSOC
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
// 超时
\PDO::ATTR_TIMEOUT => 5,
],
//max opened connection
getenv('POOL_MAX_OPEN'),
//max idle connection
getenv('POOL_MAX_IDLE'),
],
// 属性注入
'properties' => [
// 事件调度器
'dispatcher' => ['ref' => 'eventDispatcher'],
],
],
];
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
- PHP用ip curl post请求 会卡1秒 HOT 5
- 新版本性能严重下降 HOT 6
- table方法传入表名order报错 HOT 1
- 验证器场景设置optional未生效 HOT 3
- 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.