What PT_Pool?
It's a combined process+threading pool. (having only "apply_async" method for now)
ThreadPoolExecutor on its own doesn't utilize more than one CPU core.
ProcessPoolExecutor on its own is not suitable to provide concurrency (e.g. slows down the system when large number of processes are created, and doesn't allow to create more than around 1000 processes on my system).
Installation
python3.7 -m pip install PT_Pool
Usage
from PT_Pool import PT_Pool
import time
def f(x):
time.sleep(1)
return x*x
def on_result(res):
print(res)
pt_pool = PT_Pool(threads_limit = 100)
pt_pool.apply_async(f, range(10), on_result=on_result)
time.sleep(2)
input('Press enter to exit...')
Metadata
Release files for PT-Pool 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PT_Pool-0.0.4.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PT_Pool-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / PT_Pool-0.0.4.tar.gz
| Download URL | PT_Pool-0.0.4.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a2f03f76f928989a6c9ac00ebeaef6e6e7dc1c134a3f8d1b66174d22b539a97
|
|
BLAKE2b-256 checksum How to use checksums |
a366bae2364f0a83a8dbd82231aef315ab51e2b13cf94eb583fb038254daa201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.0 importlib_metadata/3.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
|
Release files / PT_Pool-0.0.4-py3-none-any.whl
| Download URL | PT_Pool-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3667b20069f007e86f088dd60834cedbf584b03b6e381114578082527cce0d43
|
|
BLAKE2b-256 checksum How to use checksums |
95d69feabf9d9aa34ba064acde212ad8647ee9fb232f73c238189f8858cb3b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.0 importlib_metadata/3.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
|