Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (10 sloc) 236 Bytes
from twisted.internet import defer
def callback(res):
print 'callback got:', res
def errback(err):
print 'errback got:', err
d = defer.Deferred()
d.addCallbacks(callback, errback)
d.callback('result')
d.cancel()
print 'done'