Imported Upstream version 12.1.0
[contrib/python-twisted.git] / doc / historic / 2003 / pycon / deferex / deferexex.py
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()