Add tulip.wait_for().

This commit is contained in:
Guido van Rossum 2013-08-20 12:38:58 -07:00
parent 96cb5702ff
commit fb6e6e94e7
1 changed files with 6 additions and 0 deletions

View File

@ -1329,6 +1329,12 @@ package are provided:
your ``for`` loop may not make progress (since you are not allowing
other tasks to run).
- ``tulip.wait_for(f, timeout)``. This is a convenience to wait for a
single coroutine or Future with a timeout. It is a simple wrapper
around ``tulip.wait()`` with a single item in the first argument,
returning the result or raising the exception if it is completed
within the timeout, raising ``TimeoutError`` otherwise.
Sleeping
--------