Comments (12)
应该是多出了一个换行符了,你不说我还真以为是类型的问题
from naruto.
而且还发现一个问题 --worker-num=1的时候 pa aux | grep php 查看是5个进程
from naruto.
完全可以啊~ 哈哈~
from naruto.
PHP7.1、7.2下报:
PHP Notice: A non well formed numeric value encountered in /vagrant_data/caipiao_api/naruto/src/Daemon.php on line 54
from naruto.
忘了说了 目前只在ubuntu&mac测试过 别的系统没测过,代码 是下面这样么?
public function check(Manager $manager)
{
if (! empty($manager->waitSignalProcessPool['signal'])) {
return;
}
// get num now
$num = shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l") - 3;
// check num
$diff = $manager->startNum - $num;
if ($diff > 0) {
// start worker
$manager->execFork($diff);
}
}
from naruto.
那块代码挺简单的 就是获取当前子进程的数量的shell 你可以debug下
from naruto.
类型转换一下就行了 $num = intval(shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l")) - 3;
from naruto.
哦哦,欢迎pr, thx~
不过奇了怪了,不是弱类型么,难道
shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l")
的结果是个非数字的字符串~
wc -l 应该是个数字啊~
from naruto.
PHP 7 慢慢的再往强类型靠
from naruto.
可以把你那边
shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l")
的结果打印发我么 我看看~
thx~
from naruto.
嗯,换行符~
bug欢迎提交 pull request,哈哈~
from naruto.
[而且还发现一个问题 --worker-num=1的时候 pa aux | grep php 查看是5个进程]
已经fix了~
thx~
from naruto.
Related Issues (4)
- 有点疑问 HOT 1
- Daemon 监听子进程数量问题 HOT 1
- Is this project active? HOT 2
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 naruto.