Skip to main content

Little process-based workers to do your bidding.

Project description

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

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

littleworkers-0.3.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file littleworkers-0.3.1.tar.gz.

File metadata

File hashes

Hashes for littleworkers-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9968c33f085c92d8c2036bc292f27acc414965e6592971b6273f9ae3f5c77341
MD5 64bfc606f1b19e1ef526f37001af921d
BLAKE2b-256 fb9e8fc9cce2549a485cdf0322bdd1371c06f047ebc774c5df92a2befc467ea6

See more details on using hashes here.

Provenance

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