Commit b2f70ab2 authored by Denis Bilenko's avatar Denis Bilenko

hub.Waiter: add __call__ (link protocol)

--HG--
extra : transplant_source : %CA%97%B0n%D4%B4%91%04%D5%C3%02%97%FB%FE%82%13Z%8F%7E%B0
parent d8468ee6
......@@ -323,6 +323,12 @@ class Waiter(object):
wait = get # XXX backward compatibility; will be removed in the next release
def __call__(self, source):
if source.exception is None:
self.switch(source.value)
else:
self.throw(source.exception)
# can also have a debugging version, that wraps the value in a tuple (self, value) in switch()
# and unwraps it in wait() thus checking that switch() was indeed called
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment