[Twisted-Python] Re: reactor.stop stops entire twistd

Christopher Armstrong radeex at gmail.com
Wed Jul 28 06:47:55 EDT 2004


On Wed, 28 Jul 2004 18:40:52 +0800, Tsai Li Ming <mailinglist at ltsai.com> wrote:
> That makes sense. Don't we need to call the deferred object at some
> point in time? Like reactor.callLater?
> 
> My apologies as I'm very new to Twisted.

No. Your call to getProcessOutput creates the Deferred object and
returns it to you. getProcessOutput starts the program and sets it up
so the Deferred will be triggered once the output is done. Your
function attaches callback(s) to the Deferred. When your function
returns, control is returned to the reactor. Eventually, the process
will finish, causing the Deferred to be triggered (which happens in
code that's connected with getProcessOutput), causing your callback to
fire with the output of the process.

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+            http://radix.twistedmatrix.com




More information about the Twisted-Python mailing list