~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/historic/2003/pycon/deferex/deferex-chaining.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.internet import reactor, defer
 
2
 
 
3
A = defer.Deferred()
 
4
def X(result):
 
5
    B = defer.Deferred()
 
6
    reactor.callLater(2, B.callback, result)
 
7
    return B
 
8
def Y(result):
 
9
    print result
 
10
A.addCallback(X)
 
11
A.addCallback(Y)
 
12
A.callback("hello world")
 
13
reactor.run()