[Twisted-Python] Gc of deferreds
Benjamin.Rutt at gs.com
Tue Jul 8 16:11:31 EDT 2008
In the following program, what prevents the deferred "d" from being
gc'd? (nothing saves the return of foo() in any variable). Do I need
to keep a reference to it around to ensure the callbacks will run?
from twisted.internet import defer,reactor,utils
d = utils.getProcessOutput('sleep', args=['2'])
print "cb fired"
Yet when I run it, it seems everything works fine:
I am just questioning the need to keep deferreds in memory somewhere, if
they haven't fired their callbacks yet. Thanks.
More information about the Twisted-Python