Commit 6c3b2629 authored by Jason Madden's avatar Jason Madden

Clarify AsyncEvent.wait documentation. Fixes #124. [skip ci]

parent 8153cd80
......@@ -263,14 +263,21 @@ class AsyncResult(object):
def wait(self, timeout=None):
"""Block until the instance is ready.
If this instance already holds a value / an exception, return immediatelly.
Otherwise, block until another thread calls :meth:`set` or :meth:`set_exception` or
until the optional timeout occurs.
If this instance already holds a value, it is returned immediately. If this
instance already holds an exception, ``None`` is returned immediately.
Otherwise, block until another thread calls :meth:`set` or :meth:`set_exception`
(at which point either the value or ``None`` will be returned, respectively),
or until the optional timeout expires (at which point ``None`` will also be
returned).
When the *timeout* argument is present and not ``None``, it should be a
floating point number specifying a timeout for the operation in seconds
(or fractions thereof).
.. note:: If a timeout is given and expires, ``None`` will be returned
(no timeout exception will be raised).
Return :attr:`value`.
"""
if self._exception is not _NONE:
......
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