Hello!
On Wed, May 22, 2013 at 1:13 AM, <llb...@gmail.com> wrote:
>
> Lua has rabbitmq client library https://github.com/tcoram/rabbitmq-lua.
>
> Can it use directly ?
>
No, it will surely block the Nginx worker processes and ruin the
performance. To quote the related parts in ngx_lua's official
documentation:
"Network I/O operations in user code should only be done through the
Nginx Lua API calls as the Nginx event loop may be blocked and
performance drop off dramatically otherwise."
See http://wiki.nginx.org/HttpLuaModule#Nginx_API_for_Lua
To summarize, you should only use a client library
1. based on either ngx_lua's cosocket API or
2. implemented as an Nginx upstream C module (and accessed by Nginx
subrequests).
Best regards,
-agentzh