We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码:
<?php use Swoole\Coroutine; function test() { Coroutine::sleep(1); var_dump('test gg'); } register_shutdown_function(function(){ var_dump('all gg'); }); go('test');
输出:
string(6) "all gg" string(7) "test gg"
我认为的正常的结果应该是协程里面的执行完,再触发register_shutdown_function吧?不知道是有意如此,还是bug
register_shutdown_function
The text was updated successfully, but these errors were encountered:
如果你的脚本末尾没有swoole_event_wait(),底层会将swoole_event_wait()注册register_shutdown_function,执行顺序就会变成上面的。
swoole_event_wait()
请在代码末尾加入 swoole_event_wait();
swoole_event_wait();
Sorry, something went wrong.
Improve swoole event wait and add a test (#2144).
ba371ee
@Yurunsoft 现在swoole_event_wait永远都是第一位, 结果符合预期
No branches or pull requests
代码:
输出:
我认为的正常的结果应该是协程里面的执行完,再触发
register_shutdown_function
吧?不知道是有意如此,还是bugThe text was updated successfully, but these errors were encountered: