https://github.com/toastdriven/littleworkers
Little process-based workers to do your bidding.
https://github.com/toastdriven/littleworkers
Last synced: 11 months ago
JSON representation
Little process-based workers to do your bidding.
- Host: GitHub
- URL: https://github.com/toastdriven/littleworkers
- Owner: toastdriven
- License: bsd-3-clause
- Created: 2011-05-19T22:59:02.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2016-02-23T02:32:45.000Z (about 10 years ago)
- Last Synced: 2025-06-07T16:54:57.472Z (11 months ago)
- Language: Python
- Homepage: http://readthedocs.org/docs/littleworkers/en/latest/
- Size: 23.4 KB
- Stars: 148
- Watchers: 6
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=============
littleworkers
=============
Little process-based workers to do your bidding.
Deliberately minimalist, you provide the number of ``workers`` to use &
a list of commands (to be executed at the shell) & ``littleworkers`` will eat
through the list as fast as it can.
Why littleworkers?
==================
``littleworkers`` shines when you just want to parallelize something without a
lot of fuss & when you care more about the data/commands to be run.
* Tiny source
* Easy to queue a set of actions
* Works with any runnable commands
* Uses processes
* Non-blocking
Seriously, it's not a replacement for threading or multiprocessing if your
application needs to share a ton of data with the children.
Usage
=====
Usage is trivial::
from littleworkers import Pool
# Define your commands.
commands = [
'ls -al',
'cd /tmp && mkdir foo',
'date',
'echo "Hello There."',
'sleep 2 && echo "Done."'
]
# Setup a pool. Since I have two cores, I'll use two workers.
lil = Pool(workers=2)
# Run!
lil.run(commands)
For more advanced uses, please see the API documentation.
Requirements
============
* Python 2.6+
:author: Daniel Lindsley
:updated: 2011/11/10
:version: 0.3.1
:license: BSD