ngx.socket.tcp可不可以在init_worker_by_lua*中使用

124 views
Skip to first unread message

leopar...@gmail.com

unread,
Sep 10, 2016, 1:39:11 AM9/10/16
to openresty
openresty的文档中ngx.socket.tcp的context没有init_worker_by_lua*, 但是有ngx.timer.*. 而ngx.timer.at可以在init_worker_by_lua中使用, 我看lua-resty-upstream-healthcheck中就这么用的
说明ngx.socket.tcp在init_worker_by_lua中使用, 这和context中写的冲突, 哪里理解有问题?

DeJiang Zhu

unread,
Sep 11, 2016, 12:25:13 AM9/11/16
to open...@googlegroups.com
Hello

在 2016年9月10日 下午1:39, <leopar...@gmail.com>写道:
openresty的文档中ngx.socket.tcp的context没有init_worker_by_lua*, 但是有ngx.timer.*. 而ngx.timer.at可以在init_worker_by_lua中使用, 我看lua-resty-upstream-healthcheck中就这么用的

ngx.timer.at 是可以在 init_worker_by_lua 内使用
 
说明ngx.socket.tcp在init_worker_by_lua中使用,

cosocket 并不能在 init_worker_by_lua 中使用

只是 cosocket 可以在 timer 内使用(即使这个 timer 是在 init_woker_by_lua 中创建的)
 
这和context中写的冲突, 哪里理解有问题?

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

Reply all
Reply to author
Forward
0 new messages