<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Yichun Zhang,<div><br></div><div>Thanks for the help! Going by the documentation of the lua-nginx-module on its subrequest handling it looks really promising for my use case. I am currently writing the Sphinx2 upstream module. Would get back with questions in case I have any on using the lua-nginx-module for achieving what I need to do.</div><div><br></div><div>Regards,</div><div>Reetesh<br><br><div>> Date: Wed, 27 Nov 2013 12:39:15 -0800<br>> Subject: Re: Help on designing using multiple location/upstream modules<br>> From: agentzh@gmail.com<br>> To: nginx-devel@nginx.org<br>> <br>> Hello!<br>> <br>> On Tue, Nov 26, 2013 at 4:30 AM, Reetesh Ranjan wrote:<br>> > I have thought of the following design, in terms of nginx modules I would<br>> > use:<br>> ><br>> > 1   My main location module that picks the keywords entered and communicates<br>> > to Redis and Sphinx<br>> > 2   For communicating to Redis I thought of using HttpRedis2Module<br>> > (http://wiki.nginx.org/HttpRedis2Module)<br>> > 3   For communicating with Sphinx, I am trying to write a simple C++ client<br>> > or adapt the Sphinx C++ client<br>> > (http://sourceforge.net/projects/cppsphinxclient/) or its parts into an<br>> > upstream module.<br>> ><br>> <br>> This looks trivial if you use ngx_lua module as the glue. In<br>> particular you can check out the ngx.location.capture and<br>> ngx.location.capture_multi API functions for captured subrequests:<br>> <br>> https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture<br>> <br>> https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture_multi<br>> <br>> And probably also the "light thread" API that can work with the<br>> subrequest API above:<br>> <br>> https://github.com/chaoslawful/lua-nginx-module#ngxthreadspawn<br>> <br>> When using the Lua API provided by ngx_lua, everything is nonblocking<br>> out of the box :)<br>> <br>> Regards,<br>> -agentzh<br>> <br>> _______________________________________________<br>> nginx-devel mailing list<br>> nginx-devel@nginx.org<br>> http://mailman.nginx.org/mailman/listinfo/nginx-devel<br></div></div>                                     </div></body>
</html>