SWOOLE_PROCESS 模式下 启动8个worker 在IndexController获取进程id 只有一个进程id 获取不到其它得进程id #6967
Unanswered
gitwangliang
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
-
播个VPN到其他区域,再试试 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
index代码
public function index()
{
$user = $this->request->input('user', 'Hyperf');
$method = $this->request->getMethod();
return [
'method' => $method,
'message' => "Hello {$user}.",
'id' => Coroutine::id(),
'getmypid' => getmypid()
];
}
刷新多次浏览器
id 会改变 这是预期的
getmypid 这个获取的是worker的id 始终是一个
在代码中使用sleep() SWOOLE_HOOK_FLAGS 设置的是SWOOLE_HOOK_CURL 情况也一样
如何才能 刷新获取到不同worker的id?
Beta Was this translation helpful? Give feedback.
All reactions