8.2.2.3. await_result¶
-
await_result
(obj, timeout=None)[source]¶ Return the result of a Future object.
Parameters: - obj (concurrent.futures.Future | object) – Value object.
- timeout (int) – The number of seconds to wait for the result if the future isn’t done. If None, then there is no limit on the wait time.
Returns: Result.
Return type: Example:
>>> from concurrent.futures import Future >>> fut = Future() >>> fut.set_result(3) >>> await_result(fut), await_result(4) (3, 4)