diff --git a/README.md b/README.md index 96d3233b..f6bb61eb 100644 --- a/README.md +++ b/README.md @@ -2154,7 +2154,7 @@ with : # Enters the block by calling acq = .done() # Checks if the thread has finished executing. = .result(timeout=None) # Waits for thread to finish and returns result. = .cancel() # Cancels or returns False if running/finished. - = as_completed() # Next() waits for next completed Future. + = as_completed() # `next()` returns next completed Future. ``` * **Map() and as\_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As\_completed() fails if next() is called too late, even if thread finished on time.** * **Exceptions that happen inside threads are raised when next() is called on map's iterator or when result() is called on a Future. Its exception() method returns exception or None.** @@ -2329,9 +2329,9 @@ import asyncio as aio ``` ```python - = aio.gather(, ...) # Schedules coroutines. Returns results when awaited. + = aio.gather(, ...) # Schedules coros. Returns list of results on await. = aio.wait(, …) # `aio.ALL/FIRST_COMPLETED`. Returns (done, pending). - = aio.as_completed() # Iter of coros. All return next result when awaited. + = aio.as_completed() # Iterator of coros. All return next result on await. ``` #### Runs a terminal game where you control an asterisk that must avoid numbers: diff --git a/index.html b/index.html index be332026..4ad272fa 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -1768,7 +1768,7 @@

Format

<bool> = <Future>.done() # Checks if the thread has finished executing. <obj> = <Future>.result(timeout=None) # Waits for thread to finish and returns result. <bool> = <Future>.cancel() # Cancels or returns False if running/finished. -<iter> = as_completed(<coll_of_Futures>) # Next() waits for next completed Future. +<iter> = as_completed(<coll_of_Futures>) # `next(<iter>)` returns next completed Future.
  • Map() and as_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As_completed() fails if next() is called too late, even if thread finished on time.
  • @@ -1909,9 +1909,9 @@

    Format

    # Schedules the coroutine for execution. <obj> = await <task> # Returns result. Also <task>.cancel(). -
    <coro> = aio.gather(<coro/task>, ...)     # Schedules coroutines. Returns results when awaited.
    +
    <coro> = aio.gather(<coro/task>, ...)     # Schedules coros. Returns list of results on await.
     <coro> = aio.wait(<tasks>, …)             # `aio.ALL/FIRST_COMPLETED`. Returns (done, pending).
    -<iter> = aio.as_completed(<coros/tasks>)  # Iter of coros. All return next result when awaited.
    +<iter> = aio.as_completed(<coros/tasks>)  # Iterator of coros. All return next result on await.
     

    Runs a terminal game where you control an asterisk that must avoid numbers:

    import asyncio, collections, curses, curses.textpad, enum, random
     
    @@ -2932,7 +2932,7 @@ 

    Format