[Twisted-Python] subclassing and class methods returning deferreds

Thomas Vander Stichele thomas at apestaart.org
Thu Jul 21 12:34:27 EDT 2005

On Thu, 2005-07-21 at 11:15 -0400, Itamar Shtull-Trauring wrote:
> On Thu, 2005-07-21 at 12:51 +0200, Thomas Vander Stichele wrote:
> > 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. 
> 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.

I'm looking into hooking up the whole application part into the service
framework, but stopService will then still need to tell these objects
that are performing tasks to stop and wait for that, so it will still
need to go up the hierarchy and process correctly.  Or am I missing
something ?

Btw, I only found a short introduction on services and .tac files, but
it doesn't really say what services are trying to solve, and when you
should use them.  Is there somewhere else I should look for that ?


Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
Gotta keep moving on
lover you hide from me every time
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/

More information about the Twisted-Python mailing list