Persistent LC server?
Richard Gaskin
ambassador at fourthworld.com
Fri Aug 2 17:16:14 EDT 2013
Monte Goulding wrote:
> Hi Richard
>
> I had a look at the engine code for you and I don't think you will
> get this to work without some modifications to the source. If you
> look at the server implementation of X_main_loop you will see that
> unlike all the other engines that repeatedly do stuff while the
> MCQuit flag is false the server engine just does it's stuff so it
> will naturally quit at the end.
Very interesting. Thanks for that background.
In your code base exploration have you discovered why the Linux Server
engine is nearly 50% larger than that non-server Linux standalone engine?
I can't imagine the extra merge functionality alone accounts for all
that space.
> Is there a reason you couldn't use the -u flag on a regular
> standalone?
None at all. In fact, I've been using standalones for CGIs for some
time (I started back when LC Server didn't support stack files as
libraries). I've grown to prefer them for many tasks, esp. given my
habit of including only function calls (rather than complete handlers)
in my HTML anyway.
> My biggest question though is what event is triggered on the
> persistent server when you request some part of your array?
> LC Server scripts are basically just one big startup handler
> without the handler declaration.
Right. If I were to pursue this I'd probably write a quasi-event look,
watching a particular socket.
At the moment, though, I'm on a different path, since I discovered a way
to make an array-like file I can access elements within from a cold
start at about 0.02ms per access, fast enough for CGI use.
--
Richard Gaskin
Fourth World
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
Follow me on Twitter: http://twitter.com/FourthWorldSys
More information about the use-livecode
mailing list