[Twisted-Python] newbie: scheduling/queuing tasks with xmlrpc

Dustin Lee qhfgva at gmail.com
Thu Mar 17 13:40:42 EST 2005

Thanks for the response.  I will give it a look see.  Still have much
to learn about twisted, but I figure I'll learn more by trying out my
ideas than just reading the tutorials over and over...


On Thu, 17 Mar 2005 18:17:15 GMT, Jp Calderone <exarkun at divmod.com> wrote:
> On Thu, 17 Mar 2005 10:29:09 -0700, Dustin Lee <qhfgva at gmail.com> wrote:
> >So I've got a simple prototype of what I'm trying to achieve with my
> > "queued tasks" xmlrpc server.
> >
> > I'd appreciate any comments, suggestions.  So far it seems to work
> > exactly I wanted but I have a feeling I'm abusing the intended use of
> > deferreds.  And that by polling I'm deviating from the twisted
> > workflow model.  But you have to start somewhere.
>   Yes, much abuse is present in this code.  A couple grievous wrongs:
>     Deferreds (and almost all other Twisted APIs) are not thread-safe.  You cannot invoke their methods in a thread other than that of the reactor.
>     The called and paused Deferred attributes are not really public.  You should avoid using them if at all possible (and it almost always is).  Likewise, the pause() and unpause() methods are more for the convenience of Deferred's implementation and you should never need to call them.
>   Attached is a modified version.  It has a problem with shutdown, which I imagine is related to not properly closing the reactor's threadpool.  Maybe someone else can suggest the correct way to deal with that.
>   Jp
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Dustin Lee

More information about the Twisted-Python mailing list