[PEAK] EventDriven, ITwistedReactor, and AdaptiveTask daemons
John Landahl
john at landahl.org
Mon Jan 5 19:10:34 EST 2004
The following chain of events seems to make it impossible to use the
Twisted reactor alongside AdaptiveTask-based daemons in an
EventDriven-based PEAK app: AdaptiveTask has an assembly event
(__addToQueue) which calls TaskQueue.addTask(), which calls
TaskQueue._scheduleProcessing(), which accesses its 'reactor' property,
which will get an IBasicReactor by default.
My application runs from within a subclass of EventDriven which has an
assembly event that sets up an ITwistedReactor and offers it as
IBasicReactor. AdaptiveTask.__addToQueue seems to get called before my
EventDriven subclass's assembly event, resulting in IBasicReactor being
used before the Twisted reactor can be setup. This of course means that
the attempt to create the Twisted reactor will cause an error when it
actually does run.
Is this the right way to go about things and something needs to be fixed,
or is there a better way to install a Twisted reactor in an EventDriven
app?
More information about the PEAK
mailing list