I want to use ngx.timer.at module to start another thread besides the "main" thread for lua worker process. From the documentation, it turned out the ngx.timer.at module make this pretty easy to achieve. However, when I have this simple code, it seems I did not really run in the backend. I tried log to log file when it starts, but the log information did not appear.
local function _hello(premature)
ngx.log(ngx.ERR, "Hello world")
if premature then
return
end
end
ngx.timer.at(0, _hello)
"Hello world" did not appear in the log file and I have no idea the new thread was ever been created successfully. Any ideas?