[Twisted-Python] subclassing and class methods returning deferreds
itamar at itamarst.org
Thu Jul 21 11:15:32 EDT 2005
On Thu, 2005-07-21 at 12:51 +0200, Thomas Vander Stichele wrote:
> I wanted to have a class hierarchy where .stop methods would make sure
> everything is cleaned up properly before reactors get stopped and such.
That's what services (twisted.application.service) are for. The
stopService method of a service can return a Deferred. Since they're a
tree, all you need to do is hook up the root service to the reactor
(which is what twistd does for you) and all child services will get
shutdown as well.
More information about the Twisted-Python