Skip to main content

ConcurrencySettings

Concurrency settings for AutoscaledPool.

Index

Constructors

Constructors

__init__

  • __init__(min_concurrency, max_concurrency, max_tasks_per_minute, desired_concurrency): None
  • Creates a new instance.


    Parameters

    • min_concurrency: int = 1

      The minimum number of tasks running in parallel. If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash.

    • max_concurrency: int = 200

      The maximum number of tasks running in parallel.

    • max_tasks_per_minute: float = float('inf')

      The maximum number of tasks per minute the pool can run. By default, this is set to infinity, but you can pass any positive, non-zero number.

    • desired_concurrency: int | None = None

      The desired number of tasks that should be running parallel on the start of the pool, if there is a large enough supply of them. By default, it is min_concurrency.

    Returns None

Page Options