lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday 24 November 2004 6:51 pm, Luiz Henrique de Figueiredo wrote:
> Javier Guerra wrote:
> > a simple sessions library, like that of PHP, can make it easier to
> > retrieve objects from storage;
>
> André de Leiradella wrote:
> > Take a look at lper, a persistent Lua implementation
>
> That works only in Unix.
>
> You can try also a database library, such as lgdbm, which has proxy tables
> that make tables persistent.
> --lhf

that's exactly my point: the "venv() for each request" model creates the 
necessity of a persistence engine.  take a look at prevayler, they claim 
enormous speedups, just because they don't have to (de)serialize everything.

what they take advantage of, is that in Java, the object state isn't flushed 
for each request.  the only other system i know that can do that is FastCGI, 
because it's a single process managing requests in an event loop.

what i'm thinking now is to simplify things radically:  i'll take just the 
fastcgi launcher of CGILua, and replace the lua-side with a minimal loop.  to 
keep different applications separate, i'll run a different launcher process 
instance for each application (i think the apache .conf lets me do it easily)

that means that each web app will have it's own lua state; one that doesn't go 
away after each request.

on this environment, a small API would let the app register scripts referenced 
by the URL, and state objects referenced by a session cookie.  no 
(de)serializing needed unless the app wants to make 'permanent' records (to a 
SQL db, usually)

does this sound more Lua-like?

-- 
Javier

Attachment: pgpznICNEHDO6.pgp
Description: PGP signature