一.问题描述 在Django视图函数中,导入 gevent 模块 import gevent from gevent import monkey; monkey.patch_all() from gevent.pool import Pool 启动Django报错: MonkeyPatchWarning: Monkey-patching outside the main native thread. Some APIs will not be available. Expect a KeyErr
swoole4.x后支持一键协程 加上后,开启一键协程化后,MySQL.Redis.Curl 等操作会变成异步 IO //此行代码后,文件操作,sleep,Mysqli,PDO,streams等都变成异步IO,见文档"一键协程化"章节 Swoole\Runtime::enableCoroutine(); Co\run(function() { // i just want to sleep... for ($c = 100; $c--;) { go(function () { for