summaryrefslogtreecommitdiff
path: root/aiogreen.py
diff options
context:
space:
mode:
Diffstat (limited to 'aiogreen.py')
-rw-r--r--aiogreen.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/aiogreen.py b/aiogreen.py
index 93a4ec1..31e53eb 100644
--- a/aiogreen.py
+++ b/aiogreen.py
@@ -306,9 +306,12 @@ def wrap_greenthread(gt, loop=None):
return fut
-def link_future(future, loop=None):
+def yield_future(future, loop=None):
"""Wait for a future, a task, or a coroutine object from a greenthread.
+ Yield control other eligible eventlet coroutines until the future is done
+ (finished successfully or failed with an exception).
+
Return the result or raise the exception of the future.
The function must not be called from the greenthread
@@ -316,7 +319,7 @@ def link_future(future, loop=None):
"""
future = asyncio.async(future, loop=loop)
if future._loop._greenthread == eventlet.getcurrent():
- raise RuntimeError("link_future() must not be called from "
+ raise RuntimeError("yield_future() must not be called from "
"the greenthread of the aiogreen event loop")
event = eventlet.event.Event()