diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-11-21 22:39:21 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-11-21 22:39:21 +0100 |
commit | d2169c664ee53322023e4832bf0ac5908a7ee1e5 (patch) | |
tree | 73d35a43d2eb0a57142e7da327c675152694307c | |
parent | 88bf0d65af930b9a5bd650aa397d2d3adcc91952 (diff) | |
download | aioeventlet-d2169c664ee53322023e4832bf0ac5908a7ee1e5.tar.gz |
wrap_greenthread() now directly calls fut.set_result() or set.set_exception()
instead of using loop.call_soon()
-rw-r--r-- | aiogreen.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/aiogreen.py b/aiogreen.py index 84759f4..6ff2b01 100644 --- a/aiogreen.py +++ b/aiogreen.py @@ -263,10 +263,10 @@ def wrap_greenthread(gt, loop=None): try: orig_main(*args, **kw) except Exception as exc: - loop.call_soon(fut.set_exception, exc) + fut.set_exception(exc) else: result = gt.wait() - loop.call_soon(fut.set_result, result) + fut.set_result(result) gt.run = wrap_func else: orig_func = gt.run @@ -274,9 +274,9 @@ def wrap_greenthread(gt, loop=None): try: result = orig_func(*args, **kw) except Exception as exc: - loop.call_soon(fut.set_exception, exc) + fut.set_exception(exc) else: - loop.call_soon(fut.set_result, result) + fut.set_result(result) gt.run = wrap_func return fut |