Welcome! Log In Create A New Profile

Advanced

Re: nginx, echo module & lua

agentzh
May 02, 2012 11:12AM
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
Subject Author Posted

nginx, echo module & lua

Pierre May 02, 2012 04:12AM

Re: nginx, echo module & lua

agentzh May 02, 2012 07:48AM

Re: nginx, echo module & lua

Pierre May 02, 2012 09:40AM

Re: nginx, echo module & lua

agentzh May 02, 2012 11:12AM

Re: nginx, echo module & lua

Pierre May 02, 2012 07:36PM

Re: nginx, echo module & lua

Antonio P.P. Almeida May 03, 2012 03:54AM

Re: nginx, echo module & lua

agentzh May 03, 2012 08:54AM

Re: nginx, echo module & lua

Pierre May 03, 2012 06:44AM

Re: nginx, echo module & lua

agentzh May 03, 2012 09:04AM

Re: nginx, echo module & lua

Pierre May 03, 2012 11:40AM

Re: nginx, echo module & lua

agentzh May 03, 2012 08:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready