Python Process Manager (processpy)
processpy is simple process manager for python. If you want to run multiple process for the same function, this tool is for you.
- You can run multiple process of the same function concurrently.
- You can choose to kill previous running process before running a new process of the same function.
- You can choose to ignore new process of the same function if it's already running.
Installation
pip install processpy
Example (No concurrency and no previous kill)
from processpy import ProcessManager
import time
def sum(a, b):
time.sleep(30)
print(a+b)
sum_process = ProcessManager(sum, kill_previous=False, concurrent_running=False)
sum_process.run({'a': 10, 'b': 20})
time.sleep(5)
"""
The following will not run. Because concurrent run is false and kill previous is also false. So, it will simply return with doing nothing and let the previous run.
"""
sum_process.run({'a': 10, 'b': 20})
Example (No concurrency but with previous kill)
from processpy import ProcessManager
import time
def sum(a, b):
time.sleep(30)
print(a+b)
sum_process = ProcessManager(sum, kill_previous=True, concurrent_running=False)
sum_process.run({'a': 10, 'b': 20})
time.sleep(5)
"""
The following will kill the previous unfinished process and run. Because concurrent run is false and kill previous is True. So, it will simply kill the previous unfinished process. If previous one is already finished, nothing to kill.
"""
sum_process.run({'a': 10, 'b': 20})
Example (with concurrency)
from processpy import ProcessManager
import time
def sum(a, b):
time.sleep(30)
print(a+b)
sum_process = ProcessManager(sum, concurrent_running=True)
sum_process.run({'a': 10, 'b': 20})
time.sleep(5)
"""
The following will run alongside of the previous process.
"""
sum_process.run({'a': 10, 'b': 20})
You can also kill the running process (if concurrent_running=False )
sub_process.kill()
Metadata
Release files for processpy 0.1.0
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 |
|---|---|---|---|---|
| processpy-0.1.0.tar.gz | 3.5 kB | Without provenance | Details for processpy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| processpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for processpy-0.1.0-py3-none-any.whl |
Total release size: 7.1 kB
Release files / processpy-0.1.0.tar.gz
| Download URL | processpy-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
340854b54281783da85b97ecc0c3f864e3a29ce827116c5495cae4df21003d34
|
|
BLAKE2b-256 checksum How to use checksums |
279c48a46116f72ba1e96a9959d06d45a97dc1aadb1dec2b290cd314dd542399
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.15 CPython/3.8.13 Windows/10
|
Release files / processpy-0.1.0-py3-none-any.whl
| Download URL | processpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
097d0aaf85bca7e4feb69e98cfc25867dff8ee32c801c0c2c3ce7d001fd09492
|
|
BLAKE2b-256 checksum How to use checksums |
0cd96bbf5958f32cc86b60037c56af1360d3672081a8a99f2082c766d12918e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.15 CPython/3.8.13 Windows/10
|
Security for processpy 0.1.0
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.