Worker Process
This package provides a wrapper to create standalone worker processes.
Example Worker
Workers are created by extending the BaseWorker class and implementing a tick method to execute then calling .main() on the class. This will start an infinite loop calling that function.
The worker can be rate limited with max_ticks_per_second.
The worker can be stopped gracefully by sending a SIGTERM to the process.
>>> import time ... ... from workerprocess import BaseWorker ... ... ... class ExampleWorker(BaseWorker): ... ... max_ticks_per_second = 10 ... ... def tick(self): ... print 'Tick!' ... time.sleep(1) ... ... ExampleWorker.main()
A sighup method on the function will be called if the process receives a SIGHUP
Running the Worker
The easiest way to be able to run the worker is by adding a console_script entry point in your setup.py:
entry_points=””” [console_scripts] example_worker_process = yourpackage.yourmodule:ExampleWorker.main “””,
After installing your package you will be able to run the command example_worker_process from the command line.
Metadata
Release files for workerprocess 0.1.2
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 |
|---|---|---|---|---|
| workerprocess-0.1.2.tar.gz | 3.0 kB | Without provenance | Details for workerprocess-0.1.2.tar.gz |
Release files / workerprocess-0.1.2.tar.gz
| Download URL | workerprocess-0.1.2.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c1ec6ee855b385298b1769f828e7946725a3528c85df08f0ab4b769770c3083
|
|
BLAKE2b-256 checksum How to use checksums |
6a93200a043322be9bee695c0df3cdbb135b686f8ebe601f04ae7c28f24805a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for workerprocess 0.1.2
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.