[Zope] Time-consuming External method blocks Zope execution

Etienne Labuschagne etiennel@geospace.co.za
Wed, 13 Jun 2001 07:51:45 +0200


Hi all

I have an external Python method that can take a long time to complete.
This method does some conversions of files on the Zope server into another
format on request of a client.  My problem is that the whole Zope
installation comes to a standstill while this method executes.  Nobody else
can get any response from the site until the external method have returned.
I know that I can make my long process run in a thread and return
immediately, but how do I notify the client browser when the thread have
finally finished.  Is the only way to write a self-reloading page as
response for the client so that his browser checks every now and again if
the process is finished

eg.

1) Client submits form with files to be converted
2) Client receives a please wait page with JavaScript (or whatever) that
will check for process completion in 10 sec.
3) Client browser aoutomatically calls a checkIfProcessIsFinished page -
gets page at 2) if it is not else gets page 4)
4) If the process was completed he gets a results page

I did make sure that my Zope does not run with the -t 0 or -D switches (it
does the same running as a service too)

Thanks
Etienne