예제 #1
0
def go(t):
    W('before %r {%d}\n' % (t, sys.get_dispatcher_depth()))
    result = t(3, 4, 5)
    W('after %r {%d}\n' % (t, sys.get_dispatcher_depth()))
    return result
예제 #2
0
 def __call__(self, *args):
     W('%r.__call__(), depth=%d\n' % (self, sys.get_dispatcher_depth()))
     coro.sleep_relative(self.sleep)
     return reduce(operator.add, args)
예제 #3
0
 def __init__(self, sleep):
     coro.sleep_relative(sleep)
     W('%r.__init__(), depth=%d\n' % (self, sys.get_dispatcher_depth()))
예제 #4
0
 def m(self, t, *args):
     W('>> %r.m(), t=%d depth=%d\n' % (self, t, sys.get_dispatcher_depth()))
     coro.sleep_relative(t)
     W('<< %r.m(), t=%d depth=%d\n' % (self, t, sys.get_dispatcher_depth()))
     return args + (42, )
예제 #5
0
def go (t):
    W ('before %r {%d}\n' % (t, sys.get_dispatcher_depth()))
    result = t(3, 4, 5)
    W ('after %r {%d}\n' % (t, sys.get_dispatcher_depth()))
    return result
예제 #6
0
 def __init__ (self, sleep):
     coro.sleep_relative (sleep)
     W ('%r.__init__(), depth=%d\n' % (self, sys.get_dispatcher_depth()))
예제 #7
0
 def __call__ (self, *args):
     W ('%r.__call__(), depth=%d\n' % (self, sys.get_dispatcher_depth()))
     coro.sleep_relative (self.sleep)
     return reduce (operator.add, args)
예제 #8
0
 def m (self, t, *args):
     W ('>> %r.m(), t=%d depth=%d\n' % (self, t, sys.get_dispatcher_depth()))
     coro.sleep_relative (t)
     W ('<< %r.m(), t=%d depth=%d\n' % (self, t, sys.get_dispatcher_depth()))
     return args + (42,)