[Twisted-Python] subclassing and class methods returning deferreds

Thomas Vander Stichele thomas at apestaart.org
Thu Jul 21 06:51:46 EDT 2005


Hi,

I wanted to have a class hierarchy where .stop methods would make sure
everything is cleaned up properly before reactors get stopped and such.
The obvious way to do that was to return a deferred that gets fired when
everything else is done, and make sure that deferred is handled
correctly everywhere.

So I wrote up an example that does this:
http://thomas.apestaart.org/download/tmp/subclass-deferred.py

I'd appreciate it if someone who's interested would take a look at it to
suggest some improvements, as I'm sure I might have overthought things a
little, or maybe there are better ways to do something like this.

Thanks,
Thomas

Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
Welcome to Hits City, Jeff K - Population: you
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/







More information about the Twisted-Python mailing list