[Zope] Return results immediately but continue processing

Dieter Maurer dieter@handshake.de
Tue, 3 Dec 2002 21:42:11 +0100


Thierry Florac writes:
 > On Mon, 2002-12-02 at 23:50, Ausum Studio wrote:
 > > Read the answer to the today's post "MessageDialog in Python Script".
 > > You may also find useful this how-to:
 > > http://www.zope.org/Members/don/long_procces
 > 
 > I've read this howto and it seems quite simple...
 > But what does happens if the user cancel the request on his browser
 > during this long-time process ??
 >  - does the process goes until the end or is it cancelled immediately ?
It goes until the end

 >  - in the first case, is there any way to check that the operation has
 > been cancelled by the browser, so that the operation can be stopped ?
This might be possible:

  Zope uses the "Medusa" framework to implement its servers.
  Medusa communicates with the client via channels.
  When the browser cancels the request, the channel is closed.

  In principle this can trigger some action although I doubt
  that it does currently.

  It may also be possible to directly check the channel state
  in the request.

  The "RESPONSE" object has a connection to the channel with
  high probability. Start your exploration there.


Dieter