Twisted 100% event driven or hybrid?

jacopo jacopo.pecci at gmail.com
Wed Sep 23 01:55:09 EDT 2009


I am diving into Twisted and Perspective Broker (PB) in particular. I
am designing a system  having several models running on different
machines, they need to be recalculated periodically, I have to collect
the results, process them and start again from the beginning.

It is not clear to me if I can blend some event driven programming
with a more traditional one where the flow would be deterministic.
In my case I have to iterate on a list of models and send the request
of recalculation to the specific machine where the model resides. I
don’t want to wait for each single result but I want to sent all the
requests in one go. In this phase I am happy to have an event driven
framework with callbacks. Then I have to stop and wait for all the
results to be ready, I collect and process them. From now on I don’t
need a the system to be event drive any more, the processing should
occur only on the master machine, following a deterministic flow.
As soon as finished I am ready to start again to resubmit the models
for recalculation and so on. This should go on forever.

Is  it possible to have an hybrid system like this? If I call
reactor.spot() at the certain point of the execution where does the
execution continue from? Would this be a good design or in general is
better to keep a 100% event drive system even if I don’t actually need
to handle asynchronicity for big chunks of the code.

I would appreciate any suggestion and for the time being I recommend
this doc, one of the clearest i have read so far.
http://www.artima.com/weblogs/viewpost.jsp?thread=230001
Grazie,
Jacopo



More information about the Python-list mailing list