- Edited
试了下,ngx.sleep(0.001)可以切换出时间片,但是ngx.sleep(0)是不可以的
这个在请求/lua时再次请求/test时有响应的,当时这样会sleep 0.001秒,改成ngx.sleep(0) 却是切换不了时间片的,连请求/test也是不通了,有什么解决方案么
location /lua { default_type text/html; content_by_lua_block { while true do ngx.sleep(0.001); end
ngx.say("hhh") } } location /test { default_type text/html; content_by_lua_block { ngx.say("hhh") } }
这个在请求/lua时再次请求/test时有响应的,当时这样会sleep 0.001秒,改成ngx.sleep(0) 却是切换不了时间片的,连请求/test也是不通了,有什么解决方案么