[Lazarus] fpWeb long process progress

Leonardo M. Ramé l.rame at griensu.com
Tue Aug 14 16:28:52 CEST 2012


On 2012-08-14 09:06:20 +0200, michael.vancanneyt at wisa.be wrote:
> 
> 
> On Mon, 13 Aug 2012, Leonardo M. Ramé wrote:
> 
> >On 2012-08-13 15:15:56 -0700, leledumbo wrote:
> >>>How can I send responses by intervals?
> >>
> >>AFAIK that's not the way web application works. It's the client that should
> >>be querying the server in a regular interval (using AJAX request perhaps).
> >>The server can track current progress status and return that right away when
> >>asked.
> >>
> >
> >Yes, I know that, but I thought Lazarus have something easy to develop
> >such process.
> >
> >The way I'm thinking of implementing is this:
> >
> >1) The client app asks the server (a CGI process) for a process ID, for
> >example 123, by calling getProcId.
> >2) Using this ID, the client calls the time-consuming task, passing the
> >ID. for example, runTask(Id). At this time, the server launches a
> >program passing the ID for the task. This must be a multi-thread
> >program, because it can be asked for running many tasks, and can be
> >asked for the status of each task. The program only finishes when the
> >last task is ended.
> >3) The client calss a getProcStatus(ID) method. The server, using IPC or
> >Pipes, asks the already-launched process for its status.
> 
> I have code which does exactly that. It's used in production. It's
> unix-only, however (it relies on fork and exec).
> 
> If you're interested, I can send you the code.
> 
> Michael.

Yes please, send me the code.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list