Dewey,

That was one of those cases where hurry really hampered intention. My
previous mail went with a missing "not" that changed the whole meaning
of it. Sorry for the noise and let me try again. :o)

On Sun, Mar 7, 2010 at 1:51 PM, Dewey Gaedcke <de...@minggl.com> wrote:
> Thanks so much for taking the time to answer me.   The whole Lua environment 
> is quite new to me and so I'm not sure I understand your answer fully.

That is fully understandable, since my answer was really confusing due
to the missing part.

Where I wrote "Note that CGI processes would certainly be the best
option here." I meant to write "Note that CGI processes would
certainly NOT be the best option here."

Again, sorry for the critical error and the noise on your comprehension.

> Since lots of my clients need to run shortest-path queries in parallelI, it 
> sounds like you are recommending CGI for my particular situation??  Am I 
> correct about that??

No, my intention was exactly the opposite, saying that CGI was NOT the
recommendation.

> If I followed your advice, and created this deamon process, what would I 
> write it with and how would it be able to obtain read-only access to these 
> two large tables in my main Lua process??

My advice would be to use a persistent process like FastCGI, but if
you end up needing to use CGI, the deamon could be written in Lua if
you wanted. It would be basically a socket listening server that would
accept requests, eval the short path using the in memory data
structure you have, and reply with the appropriate response.

In that direction, you may check Copas to see if it would work for
you, or use Xavante as a web server with persistent states and use
HTTP as the protocol for your requests (for example in JSON or simply
a serialized Lua table).

> Do you know of any articles or tech specs I can read to understand how to do 
> this?

If you are not comfortable with the idea of writing a deamon, please
consider writing your web application in WSAPI using FastCGI or some
other persistent connector.

I'd leave this CGI+deamon solution as a last resort.

> I'm also unclear why Rings won't work?  It it because a Rings can't access 
> the memory/tables of their master?

Rings is a module that allows Lua code to create and manipulate
different Lua states.

If you are using CGI, no matter how many states you have they will all
finish when the CGI process ends its life (at the end of the request).

If you are not using CGI, then Rings may be redundant, since you will
be writing the code for the whole application and probably won't need
to protect the requests from yourself. :o)

> Thanks so much for your guidance,

You are welcome. Once again, my bad for the incongruent answer the
first time. I hope the NOTs are in the right places now...

André

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to