Welcome! Log In Create A New Profile

Advanced

Re: nginx, echo module & lua

agentzh
May 03, 2012 08:36AM
On Thu, May 3, 2012 at 7:34 AM, Pierre <serarien@baqs.net> wrote:
>> There's already several Lua drivers based on that, including
>> memcached, redis, mysql, http, and mongodb. For instance, the
>> lua-resty-redis library:
>>
>> https://github.com/agentzh/lua-resty-redis
>>
>
> how can I combine cosocket & foreign upstream ?
> also, I didn't find any example involving cosocket between locations, or maybe
> I'm getting it wrong.
>

The cosocket API is used to talk to remote servers in TCP or unix
domain sockets directly. It does not support the subrequest model at
all so it is not used for reusing existing upstream modules.

The "cosocket" term is short for "coroutine-based socket", it is a
parallel implementation as ngx_http_usptream, see the following graph:

http://agentzh.org/misc/slides/libdrizzle-lua-nginx/#57

>> > 2. when in config: set_by_lua_file $varname luafile.lua , and luafile.lua
>> > references to ngx.ctx,
>> > I get the following error:
>> > (lua-error)...no request ctx found
>> > according to the doc, ngx.ctx is available in set_lua*, but does not work.
>> > Would anybody suggest
>> > me a workaround ?
>> >
>>
>> This is indeed a bug. Thanks for reporting this!
>>
>> I've just committed a patch for it:
>>
>> https://github.com/chaoslawful/lua-nginx-module/commit/bee1cab
>
> works like a charm, thanks !
>

Sorry, my previous patch introduced a bad memory leak and I've just
committed the following patch to fix this:

https://github.com/chaoslawful/lua-nginx-module/commit/8d2878

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: 136
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready