Concurrency

Overview

Prism supports concurrency via the concurrency keyword argument in the PrismProject class. This variable tells Prism how many workers should execute the project.

The default value for concurrency is 1. This means that only one worker is used to execute the tasks in the Prism project, and so non-dependent tasks cannot be run in parallel.

Setting concurrency = 2 will allow Prism to use two worker processes to execute the tasks. This means that two tasks can be run simultaneously (assuming that those two tasks are not dependent on one another). For example:

For maximum concurrency, you can set THREADS = os.cpu_count():

# example_project.py

import os

from prism.client import PrismProject

project = PrismProject(concurrency=os.cpu_count())

Last updated