openresty+lua 连接 etcd 线程阻塞问题

122 views
Skip to first unread message

Melon

unread,
Nov 27, 2017, 11:08:07 PM11/27/17
to openresty

如上图,是我的代码。通过http chunk连接到etcd,会阻塞当前线程。  通过以下任何一种方式加载Lua脚本都会造成线程阻塞  init_by_lua_file 'lua/etcd/init_watch.lua';     init_worker_by_lua_file 'lua/etcd/init_watch.lua'; ,请问有什么办法开启新的线程执行我这个脚本吗?希望实现etcd有数据变更主动通知到openresty




kfli...@gmail.com

unread,
Dec 11, 2017, 3:35:13 AM12/11/17
to openresty
 
为什么你的http请求会阻塞nginx 进程呢? 用的不是lua-resty-http吗?
Reply all
Reply to author
Forward
0 new messages