Skip to content

Commit

Permalink
Threading
Browse files Browse the repository at this point in the history
  • Loading branch information
gto76 committed Jan 27, 2024
1 parent c95e741 commit 8a553ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ with <lock>: # Enters the block by calling acq
<bool> = <Future>.cancel() # Cancels or returns False if running/finished.
<iter> = as_completed(<coll_of_Futures>) # Next() waits for next completed Future.
```
* **Map() and as\_completed() also accept 'timeout' argument. It causes TimeoutError when next() is called if result isn't available in 'timeout' seconds from the original call.**
* **Map() and as\_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called. Map() times from original call and as_completed() from first call to next().**
* **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.**
* **ProcessPoolExecutor provides true parallelism, but everything sent to/from workers must be [pickable](#pickle). Queues must be sent using executor's 'initargs' and 'initializer' parameters.**

Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<body>
<header>
<aside>January 22, 2024</aside>
<aside>January 27, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>

Expand Down Expand Up @@ -1774,7 +1774,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
&lt;iter&gt; = as_completed(&lt;coll_of_Futures&gt;) <span class="hljs-comment"># Next() waits for next completed Future.</span>
</code></pre>
<ul>
<li><strong>Map() and as_completed() also accept 'timeout' argument. It causes TimeoutError when next() is called if result isn't available in 'timeout' seconds from the original call.</strong></li>
<li><strong>Map() and as_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called. Map() times from original call and as_completed() from first call to next().</strong></li>
<li><strong>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.</strong></li>
<li><strong>ProcessPoolExecutor provides true parallelism, but everything sent to/from workers must be <a href="#pickle">pickable</a>. Queues must be sent using executor's 'initargs' and 'initializer' parameters.</strong></li>
</ul>
Expand Down Expand Up @@ -2932,7 +2932,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment


<footer>
<aside>January 22, 2024</aside>
<aside>January 27, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

Expand Down

0 comments on commit 8a553ce

Please sign in to comment.