Welcome! Log In Create A New Profile

Advanced

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Alexander Kunz
February 10, 2011 05:28AM
Thanks for sharing so many of your Nginx addons, Nginx scripting is so
exciting. I read
your 2 slides about Nginx scripting. Very intersting, are there some
more examples or informations
about Nginx scripting?

I try out your example, you subrequest on a redis location. I use the
redis2 addon, but i
allways get in the first line the bytes for my redis request. Is there a
solution hide this information?
So it would be possible to use redis2 for caching whole HTML pages.

Have a nice day agentzh!

Best regards

Alexander





On 10.02.2011 06:30, agentzh wrote:
> On Wed, Feb 9, 2011 at 6:34 PM, Marcus Clyne<maccaday@gmail.com> wrote:
>> Hi,
>>
>> Nice work guys!
>>
> Thanks! :D
>
>> Is it also possible to pass an array of requests and get an array of
>> responses, or otherwise send requests in parallel when you don't know in
>> advance how many subrequests you want to issue?
>>
> Sure! For instance,
>
> -- construct the requests table
> local reqs = {}
> table.insert(reqs, { "/mysql" })
> table.insert(reqs, { "/postgres" })
> table.insert(reqs, { "/redis" })
> table.insert(reqs, { "/memcached" })
>
> -- issue all the requests at once and wait when they all return
> local resps = { ngx.location.capture_multi(reqs) }
>
> -- loop over the responses table
> for i, resp in ipairs(resps) do
> -- process the response table "resp"
> end
>
> Well, it's mostly a feature on the Lua language level ;)
>
>> Looking at the documentation, it doesn't appear that this is currently
>> possible.
> I'll add a note for this to ngx_lua's documentation :)
>
>> I'd like to get into using Lua on Nginx for something I'm working on right
>> now that issues lots of subrequests, but I don't know how many I need to
>> issue in advance.
>>
> Yeah, that's understandable :)
>
> BTW, I've cc'd the nginx mailing list for reference :)
>
> Cheers,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


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

[ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

agentzh February 09, 2011 05:08AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

agentzh February 10, 2011 12:34AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Eugaia February 10, 2011 04:08AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Alexander Kunz February 10, 2011 05:28AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

agentzh February 10, 2011 05:38AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Roman Vasilyev February 10, 2011 05:42PM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Roman Vasilyev February 10, 2011 05:44PM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

kindy February 10, 2011 09:06PM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

agentzh February 11, 2011 12:06AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Roman Vasilyev February 11, 2011 03:00PM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

agentzh August 09, 2011 12:04AM

Re: [ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

agentzh August 09, 2011 12:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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