You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to guarantee same api interface , new features should be modfied after object created.
26
-
Could change minimum/maximum activate worker num , and set after how many seconds will the idle thread terminated.
27
-
By default , min_workers = 4 , max_workers = 256 on windows and 512 on linux , keep_alive_time = 100s.
25
+
26
+
    In order to guarantee same api interface , new features should be modfied after object created.
27
+
    Could change minimum/maximum activate worker num , and set after how many seconds will the idle thread terminated.
28
+
    By default , min_workers = 4 , max_workers = 256 on windows and 512 on linux , keep_alive_time = 100s.
28
29
29
30
30
31
## Example
31
32
32
-
Very the same code in official doc [https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example](https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example) , with executor replaced:
33
+
Very the same code in official doc [#threadpoolexecutor-example](https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example) , with executor replaced:
33
34
```Python3
34
35
# requests_test.py
35
36
import concurrent.futures
@@ -47,8 +48,8 @@ def load_url(url, timeout):
47
48
return conn.read()
48
49
49
50
with ThreadPoolExecutorPlus.ThreadPoolExecutor(max_workers=5) as executor:
future_to_url = {executor.submit(load_url, url, 60): url for url inURLS}
53
54
for future in concurrent.futures.as_completed(future_to_url):
54
55
url = future_to_url[future]
@@ -60,7 +61,7 @@ with ThreadPoolExecutorPlus.ThreadPoolExecutor(max_workers=5) as executor:
60
61
print('%r page is %d bytes'% (url, len(data)))
61
62
```
62
63
63
-
Same code in [https://docs.python.org/3/library/asyncio-eventloop.html?highlight=asyncio%20run_in_executor#executing-code-in-thread-or-process-pools](https://docs.python.org/3/library/asyncio-eventloop.html?highlight=asyncio%20run_in_executor#executing-code-in-thread-or-process-pools) with executor replaced:
64
+
Same code in offcial doc [#executing-code-in-thread-or-process-pools](https://docs.python.org/3/library/asyncio-eventloop.html#executing-code-in-thread-or-process-pools) with executor replaced:
0 commit comments