~ntt-pf-lab/nova/monkey_patch_notification

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/historic/2003/pycon/deferex/deferexex.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
 
 
2
# DEFERred EXecution EXamples
 
3
 
 
4
### make sure errors come out in order
 
5
import sys
 
6
from twisted.python import log
 
7
log.logerr = sys.stdout
 
8
 
 
9
# Create a pseudo "remote" object for executing this stuff
 
10
from twisted.spread.util import LocalAsRemote
 
11
class Adder(LocalAsRemote):
 
12
    def async_add(self, a, b):
 
13
        print 'adding', a, b
 
14
        return a + b
 
15
        
 
16
adder = Adder()