Parallel subrequests

Maxim Dounin mdounin at mdounin.ru
Thu Dec 19 15:23:42 UTC 2013


Hello!

On Thu, Dec 19, 2013 at 02:59:03AM -0500, honwel wrote:

> Hi
> 
>    I want write a http hadler(using subrequest) to deal with combine
> response from mutiple backend. but "Emiller's Advanced Topics In Nginx
> Module Development - 2.3. Sequential subrequests" issue that "  Subrequests
> might need to access the network, and if so, Nginx needs to return to its
> other work while it waits for a response. So we need to check the return
> value of ngx_http_subrequest"  
>   How to write a Parallel subrequests which several subrequests by POST in
> parallel rather than one by one after received preivous response ?  
> thanks.

Just call ngx_http_subrequest() multiple times.  Take a look at 
the source to understand how it works.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list