[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [CGILua] State persistent table
- From: Javier Guerra <javier@...>
- Date: Tue, 14 Dec 2004 12:24:56 -0500
On Tuesday 14 December 2004 11:16 am, Tomas wrote:
> > what i propose is: just before checking for the
> > luaPage file, check a table, if there's a function associated with that
> > URL, call it instead of loading the luaPage. if there's not, load it.
> > simple, lightweight, fast.
>
> You can build a script that does this.
yep, but it would be far more efficient to do it before loading any external
script. unless it's already doing some cache... a simple weak table would
be roughly equivalent to what i propose
> > not one process per user, just a coroutine. the 'getevent()' function
> > would do a yield, and the RPC would take a session id and retrieve the
> > coroutine to resume.
>
> Therefore you'll only respond one request at a time! And
> you'll have to manage this shared global environment amongst all
> coroutines.
right, that's the limitation of non-preemptive multitasking; but if every
event is managed on sub-second times, it wouldn't be noticeable for a medium
group of users. for wide scalability, fastCGI with SA could help
about the shared global environment, would that be too messy? i liked that
part on the lua reference where says "Q: how do i avoid.. ? A: if you don't
want to do something, just don't, Lua doesn't have protection mechanisms" (or
something similar)
--
Javier
Attachment:
pgpIUhFMzpXmN.pgp
Description: PGP signature