A small package for dealing with pools, workers and queues.
Project description
Pool_Workers
Pool_Workers is a small package for dealing with pools, workers and queues.
Installation:
$ pip install pool_workers
How to Use?
Please see some examples at 'examples' folder.
More info:
Describe some useful functions at pool & worker objects
pool = Pool(...)
pool.start() # Start all workers to process queue tasks.
pool.is_alive() # Return true if is there any alive worker, else false.
pool.is_idle() # Return true if is there any worker in idle mode, else false.
pool.is_done() # Return true if the queue is empty (no tasks left to process).
pool.is_paused() # Return true if the all workers have been paused, else false.
pool.shutdown() # Abort all workers
pool.join() # Wait for all workers to finish the all queue tasks.
pool.result() # return a list result
pool.pause() # pause the all workers
pool.resume() # resume the all workers
pool.count() # count workers
pool.update() # adjust the number of workers
worker = Worker(...)
worker.start()
worker.abort() # stop worker in a safe way
worker.aborted()
worker.pause()
worker.paused()
worker.resume()
# And like a normal thread, worker has also:
worker.is_alive()
worker.join()
License
MIT License
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
pool_workers-0.0.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for pool_workers-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea38e856f4cdf75d82a63772f342477ad610ff943b89fca86179bb1f7ba3254 |
|
MD5 | fc6b8f703de146e6586e1e1f7ac964e2 |
|
BLAKE2b-256 | f5485be15e82f8a158d5477cb3394d1fd2acd8b1f1d837d309c447c4a39ddcf6 |