simple_multiprocessing
Description
Execute multiple async tasks (via multiprocessing.Process, or threading.Thread) as simple as possible.
Install
pip install simple_multiprocessing
# or
pip3 install simple_multiprocessing
Usage
from simple_multiprocessing import MultiThread, MultiProcess, Task
import random, time
def test_func(i: int) -> float:
print('started:', i)
start = time.time()
start / i
if random.random() < 0.5:
while True:
time.sleep(0.01)
res = time.time() - start
return res
tasks = [Task(test_func, i) for i in range(5)]
# via threading
results_via_threading = MultiThread(tasks).solve(timeout=1)
for i, r in enumerate(results_via_threading):
print(i, type(r), r)
# via Multiproccess
results_via_multiprocess = MultiProcess(tasks).solve(timeout=1)
for i, r in enumerate(results_via_multiprocess):
print(i, type(r), r)
Dependencies
Metadata
Release files for simple-multiprocessing 0.0.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple_multiprocessing-0.0.15.tar.gz | 5.9 kB | Without provenance | Details for simple_multiprocessing-0.0.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_multiprocessing-0.0.15-py3-none-any.whl | Python 3 | none | any | Details for simple_multiprocessing-0.0.15-py3-none-any.whl |
Total release size: 14.4 kB
Release files / simple_multiprocessing-0.0.15.tar.gz
| Download URL | simple_multiprocessing-0.0.15.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86c625234bed3f47725ede8154b251b21a558c3224d20dab0bcb90bd31cce721
|
|
BLAKE2b-256 checksum How to use checksums |
3dd09ee1ce28bbf3e89ec082853f44b7539edbc3736ccf3f5ad87bf736657613
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
|
Release files / simple_multiprocessing-0.0.15-py3-none-any.whl
| Download URL | simple_multiprocessing-0.0.15-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee91cde0b279d9b2e7a0a88949cbfc882267f660e4683782b9d4805d9a76ca72
|
|
BLAKE2b-256 checksum How to use checksums |
27b818b431d7bb4fb7963133658fc5d1b8ca759b1e618fbfcd5752126dead2d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
|
Security for simple-multiprocessing 0.0.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.