在 init_worker_by_lua_file 中使用 ngx.timer.at 函数似乎无效

我想在 Lua 工作进程中使用 ngx.timer.at 模块启动另一个线程。从文档中得知,ngx.timer.at 模块使这一目标非常容易实现。然而,当我使用了以下简单的代码后,似乎并没有在后台运行。我尝试记录日志到日志文件中,但日志信息并未出现。

local function _hello(premature)
    ngx.log(ngx.ERR, "Hello world")
    if premature then
        return
    end
end

ngx.timer.at(0, _hello)

"Hello world" 没有出现在日志文件中,我不知道新线程是否被成功创建。有什么想法吗?

点赞
用户5120986
用户5120986

原文:

Turned out this is caused by another problem. Close it here: https://groups.google.com/forum/#!topic/openresty-en/m-5a1Xrpruw

翻译:

原来这是另一个问题引起的。在这里关闭它: https://groups.google.com/forum/#!topic/openresty-en/m-5a1Xrpruw

2017-11-06 09:27:28