Daniel Lindsley, of
django-haystack,
django-tastypie, and
itty fame, just launched a
small but useful project.

Littleworkers.

This extremely minimal Python module allows you to set a list of command
strings to be executed by the system, and it eats through them in a process pool.

Example usage:

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)

Simple. Pythonic.


Have comments? Send a tweet to @TheChangelog on Twitter.

Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.