Hi, I am new to Prefect and trying to set the max...
# ask-community
j
Hi, I am new to Prefect and trying to set the max number of concurrency jobs via Python. I've read the documentation and gives an example using async. However, I am using map. Can someone help me limit the number of jobs to 2?
Copy code
@flow(name="pipeline", task_runner=ConcurrentTaskRunner())
def pipeline(pipelines, X_train, y_train):

    # async with get_client() as client:
        # limit_id = await client.create_concurrency_limit(tag="process", concurrency_limit=2)

    results = [task.result() for task in process.map(pipelines, unmapped(X_train), unmapped(y_train))]