Skip to main content

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


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.2.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

workerqueue-0.0.2-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file workerqueue-0.0.2.tar.gz.

File metadata

  • Download URL: workerqueue-0.0.2.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for workerqueue-0.0.2.tar.gz
Algorithm Hash digest
SHA256 316d3fd53f4f3513abd86009f65ef1c2e2a80945372ac07202f2a375ad97838e
MD5 6d63fa7f655747cfb3c6e4368505498f
BLAKE2b-256 dc1cba0164889a2ee58357af4231528e2271c36370f3a937ebb98bbf1c8bbdc3

See more details on using hashes here.

File details

Details for the file workerqueue-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: workerqueue-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for workerqueue-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2ca90a4b41938ec3d3ca01e2be620cec63ce8d19a2534b6a1e2991102bda93a
MD5 47197678fda34ff8bed05a5346126b1d
BLAKE2b-256 9597d08f9efca71630f0b6aa72e6b99a901b5e1095484b25b7e852d4fcfa7d7d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page