Persistent LC server?
Richard Gaskin
ambassador at fourthworld.com
Thu Aug 1 16:26:39 EDT 2013
Peter W A Wood wrote:
> Richard
>
> On 1 Aug 2013, at 11:34, Richard Gaskin wrote:
>
>> The trick here is that LC Server is designed to run as a CGI;
> that is, the process is born, lives, and dies in the time it
> takes to satisfy a request.
>
> It is your choice whether to run LC Server as a CGI or not:
>
> Schulz:LiveCodeServer peter$ cat > hr.lc
> <?lc
> put "Hello Richard. No CGI here"
> ?>
>
>
> Schulz:LiveCodeServer peter$ ./livecode-server hr.lc
> Hello Richard. No CGI here
>
> You should be able to run the same code as you would run using the
> Desktop version save for the GUI. I guess the pitfall of this
> approach is that you can only handle one request at a time.
There's a second pitfall, which is critical for my situation:
My goal is to have my program return values from an array. This would
mean, of course, that the program instance never quits.
I've been experimenting with key-values stores on disk as an
alternative, and have the time down to 0.2ms so I may not spend much
time with this array notion going forward.
Still, there may be other cases where using LC as a faceless daemon may
be useful, so hopefully one of us will get some time to explore that one
day.
--
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