Skip to main content

prefect.server.api.concurrency_limits

Routes for interacting with concurrency limit objects. This module provides a V1 API adapter that routes requests to the V2 concurrency system. After the migration, V1 limits are converted to V2, but the V1 API continues to work for backward compatibility.

Functions

create_concurrency_limit

Create a task run concurrency limit. For more information, see https://docs.prefect.io/v3/concepts/tag-based-concurrency-limits.

read_concurrency_limit

Get a concurrency limit by id. The active slots field contains a list of TaskRun IDs currently using a concurrency slot for the specified tag.

read_concurrency_limit_by_tag

Get a concurrency limit by tag. The active slots field contains a list of TaskRun IDs currently using a concurrency slot for the specified tag.

read_concurrency_limits

Query for concurrency limits. For each concurrency limit the active slots field contains a list of TaskRun IDs currently using a concurrency slot for the specified tag.

reset_concurrency_limit_by_tag

delete_concurrency_limit

delete_concurrency_limit_by_tag

increment_concurrency_limits_v1

Increment concurrency limits for the given tags. During migration, this handles both V1 and V2 limits to support mixed states. Post-migration, it only uses V2 with lease-based concurrency.

decrement_concurrency_limits_v1

Decrement concurrency limits for the given tags. Finds and revokes the lease for V2 limits or decrements V1 active slots. Returns the list of limits that were decremented.

Classes

Abort

Delay