On Wed, May 2, 2012 at 9:39 PM, Pierre <serarien@baqs.net> wrote:
>> But you're encouraged to try out ngx_lua's cosocket API to avoid
>> subrequests altogether. And the cosocket stuff does not have such
>> limitations.
> hmm, any more documentation about that ?
See the official documentation for ngx_lua cosocket:
http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp
> More about: how to implement it in my lua scripts ?
>
> is that it ? :
>
> local tcp = ngx.socket.tcp
>
> function new(self)
> return setmetatable({ sock = tcp() }, mt)
> end
> ?
See the lua-resty-redis, lua-resty-memcached, and lua-resty-mysql
libraries as examples:
https://github.com/agentzh/lua-resty-redis
https://github.com/agentzh/lua-resty-memcached
https://github.com/agentzh/lua-resty-mysql
bigplum has been working on lua-resty-mongol:
https://github.com/bigplum/lua-resty-mongol
I'm not sure about its state, but you can read the document or contact
the author directly.
Best regards,
-agentzh
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx