/job-queue

A multi-process job queue

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

A multi-process job queue

Latest version Documentation Test cases Test coverage

Description

This package implements a queue that distributes jobs over multiple processes.

License

The code is distributed under the terms of the BSD 3-Clause license (see LICENSE), and the documentation is distributed under the terms of the Creative Commons BY-SA 4.0 license.

Usage

import parq

# Define a job that prints its input argument.
def my_job(n):
    print(f'Running job #{n}')

# Define the input argument for each job.
job_inputs = [(i,) for i in range(10)]

# Run these 10 jobs using 4 processes.
success = parq.run(my_job, job_inputs, n_proc=4)
assert success

See the online documentation for further details.

Installation

To install the latest release:

pip install parq

To install the latest development version, clone this repository and run:

pip install .