A thread-based worker queue
Project description
workerqueue
A thread-based worker queue
Installation
pip install workerqueue
Usage
from workerqueue import WorkerQueue from time import sleep def myfunc(arg1, arg2): print(f"{arg1}*2={arg2}") sleep(0.5) myqueue = WorkerQueue(myfunc, thread_count=2) for i in range(10): myargs = i, i*2 myqueue.put(myargs) sleep(1) print("Calling stop()...") myqueue.stop() print("Finished processing")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size workerqueue-0.0.2-py3-none-any.whl (2.2 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size workerqueue-0.0.2.tar.gz (1.7 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for workerqueue-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2ca90a4b41938ec3d3ca01e2be620cec63ce8d19a2534b6a1e2991102bda93a |
|
MD5 | 47197678fda34ff8bed05a5346126b1d |
|
BLAKE2-256 | 9597d08f9efca71630f0b6aa72e6b99a901b5e1095484b25b7e852d4fcfa7d7d |