Welcome! Log In Create A New Profile

Advanced

Re: Nginx lua capture_multi fire and forget

Yichun Zhang (agentzh)
October 26, 2013 02:10AM
Hello!

On Wed, Oct 23, 2013 at 2:46 AM, PieterVI wrote:
> Is there a way to have the lua module launch the requests without waiting
> for the response?
> It should fire the requests and continue directly afterwards and forget
> about the response handling.
> I could try and modify the lua module, but I'm not really familiar with
> C/C++ coding.
>

Completely forget the response handling is not a really good thing to
do here. You can, however, make the upstream requests and response
handling run in the "background" without adding any latency to your
downstream requests. Basically, you can just use ngx_lua's timer API
and lua-resty-http-simple library for this:

https://github.com/chaoslawful/lua-nginx-module#ngxtimerat
https://github.com/bakins/lua-resty-http-simple

The only limitation (right now) is that lua-resty-http-simple does not
support https yet. Hopefully you don't use it.

BTW, it looks like you're trying to do something that tcpcopy may help you:

https://github.com/wangbin579/tcpcopy

BTW 2: you may want to join the openresty-en mailing list for such
questions so that you may get faster responses:

https://groups.google.com/group/openresty-en

This is also recommended in ngx_lua's official documentation:

https://github.com/chaoslawful/lua-nginx-module#community

Best regards,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx lua capture_multi fire and forget

PieterVI October 23, 2013 05:46AM

Re: Nginx lua capture_multi fire and forget

Yichun Zhang (agentzh) October 26, 2013 02:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 325
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