[Lazarus] creating a Lazarus package "NoGUIApplication"

Michael Schnell mschnell at lumino.de
Wed Mar 17 12:26:38 CET 2010


On 03/15/2010 08:54 PM, Joost van der Sluis wrote:
>
> Fcl-web is a framework on which you can make 'anything' you want. You
> can use FCGI and your program will be persistent. You can use the
> webmodules. If you do, you can let the framework create a new webmodule
> for every call. (REST) But you can also make them persistent. You can
> even bind them to one session. So you have one Webmodule persistent in
> memory for every session.
>   

I don't understand how this can work.
If you install you CGI on a hired web server, same will not provide a
GUI APi, so you can't do this program as a normal "Application" e.g.
with GTK binding.
If you therefor use the "nogui" Widget Type, the program can't handle
events and thus will stop as soon as the user code is done. Thus it is
not "persistent".


> It doesn't have a queue, though. Because the web-server handles that.
> (Each http-request is an event) 
How are such events communicated from the web server to the CGI program
?  What mechanism "fires" these events within the GCI code ? How is the
program supposed to wait for such an event ?

> Using an HTTP connection which is kept open is not supported. You could
> try to add it, though. 
This is a different task from what I am up to. My intent is not CGI but
embedded applications. But I'm sure that there are viable projects
requiring this, including doing a web-GUI to an embedded application
(but I decided not to go for this)
> But maybe that you have to add more threading and
> polling code, indeed.
>   
IMHO the way to go for that is using the said NoGUIApplication. You
supposedly will use threads for the pipe- or TCP/IP-based connection to
the web server needed by a persistent CGI (see my questions above)
> What's wrong with using remote-X?

I feel, this overhead is not appropriate with a (small hardware)
embedded device. NX seems to provide a more appropriate protocol, but
still the widgets need to be handled on the embedded site.

Thanks,
-Michael




More information about the Lazarus mailing list