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):
myqueue.put((str(i), str(i * 2)))
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.
Source Distribution
workerqueue-0.0.1.tar.gz
(1.6 kB
view hashes)
Built Distribution
Close
Hashes for workerqueue-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab5dfea69c8d51c7560af95c4458b92e4d2d23e7f324422b2e7e36294164dfe7 |
|
MD5 | bba330135f620b07dbab78846cf47c6e |
|
BLAKE2b-256 | 598783bd45ec23aaff7f769155b3d698257b85756159e9d85682534cea97f185 |