[Zope] Asynchronous dtml?

Dieter Maurer dieter@handshake.de
Tue, 12 Jun 2001 22:17:49 +0200 (CEST)


Paul Zwarts writes:
 > If you have time consuming dtml in a method, is it possible to call the DTML
 > method and allow it to run by itself (in paralell), where its completion
 > being independant from the page being written to the client?
This will not be easy:

  what should your DTML do?

    1. build the response to the request?
       In this case, you would need to wait for the method
       finishing before the request is completed

    2. change the data?

       in this case, you need a ZODB connection.
       These connections are the limiting factor for
       the number of Zope threads.
       As I understand, there are up to seven connections.

In principle, you can spawn a new thread for asnychronous
DTML execution. But you must be very careful, as you
may leave the relatively safe Zope execution context
(automatic transaction management, replicated data per
thread, conflict resolution).


Dieter