hi all,
假设服务器端通过一个睡眠函数sleep等待10秒,循环不停的向浏览器推送数据
location /s {
content_by_lua '
while true do
local f = assert(io.open("./d.txt",r))
local t = f:read("*all")
os.execute("sleep " .. 10)
wb:send_text(t)
....
end
....
'
}
location /other {
....
}
那么服务端就会阻塞了,我们再去访问location /other等就会一直等待,访问不了。
请教这种情况是不是在location /s中要用lua的协程之类的?
谢谢
--
Best Regards,
Harold Miao