Welcome! Log In Create A New Profile

Advanced

Re: Communications Sequence with Upstream

agentzh
April 26, 2010 07:50AM
On Mon, Apr 26, 2010 at 6:33 PM, Magnus Lynch <maglyx@gmail.com> wrote:
> On Sun, Apr 25, 2010 at 2:35 AM, agentzh <agentzh@gmail.com> wrote:
>
> Thanks. I looked over echo_location. It uses ngx_http_subrequest,
> which I had gathered to be limited to concatenating responses
> together, and it still appears that way to me. It appears there's no
> hook for you to deal with the data the subrequest produces, as the
> various filter hooks the upstream support provides.
>

And that's way I said "echo_location" does not expose the full power
of nginx subrequests. We can use filters to capture all the outputs of
subrequests, as be done in my fork of ngx_eval module:

http://github.com/agentzh/nginx-eval-module

We'll use this trick again in our ngx_lua's ngx.subrequest.capture
implementation.

> I'm interested in a more general ability to:
> handler sends arbitrary message x_1, response y_1 comes back, ...
> repeat n times. handler sends response f(y_1, ..., y_n) to original
> query, f an arbitrary function--which is to say I want to have the
> responses passed through a filter of mine as they're generated, not
> sent straight to the client.
>

Sure you can do that. That's the way to go ;)

> Maybe I'll have to write my own code from scratch for dealing with this.
>

Indeed :)

BTW, I looked over the related code in ngx_echo which was written 5
months ago and found that it does not get r->main->count right for
nginx 0.8.x >= 0.8.11. I'll rewrite the main dispatcher and the
related parts for echo_location, echo_subrequest, and echo_sleep in
the next day or two and make a new release.

I apologize for not updating the ngx_echo codebase in time. People who
have copied the current implementation of
echo_subrequest/echo_location should update their code according to
the next release of ngx_echo. I'm sorry :P

Cheers,
-agentzh

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

Communications Sequence with Upstream

Magnus Lynch April 25, 2010 05:04AM

Re: Communications Sequence with Upstream

agentzh April 25, 2010 05:38AM

Re: Communications Sequence with Upstream

zhicheng April 25, 2010 06:29AM

Re: Communications Sequence with Upstream

agentzh April 25, 2010 06:46AM

Re: Communications Sequence with Upstream

agentzh April 25, 2010 06:48AM

Re: Communications Sequence with Upstream

zhicheng April 25, 2010 11:36AM

Re: Communications Sequence with Upstream

Magnus Lynch April 26, 2010 06:40AM

Re: Communications Sequence with Upstream

agentzh April 26, 2010 07:50AM

Re: Communications Sequence with Upstream

agentzh May 04, 2010 10:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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