Thread
#prefect-community
    j

    Jasono

    1 year ago
    Hi, If I have two tasks in a flow that have no interdependency, how do I make them run concurrently? For instance, this seems to cause task2 to wait until task1 finishes although task2 isn't dependent on task1.
    with Flow('') as flow
    r=task1()
    r2=task2()
    task3(r)
    
    flow.run()
    m

    Marwan Sarieddine

    1 year ago
    Hi - you won't get concurrency calling flow.run in local mode by default ...
    j

    Jasono

    1 year ago
    How about in server mode? How do I make it run concurrently? Can't seem to find documentation on that.
    m

    Marwan Sarieddine

    1 year ago
    the common approach is to make use a DaskExecutor
    there is a LocalDaskExecutor option as well ... see https://docs.prefect.io/core/advanced_tutorials/local-debugging.html#localdaskexecutor for more details
    j

    Jasono

    1 year ago
    Thank you. WIll take a look!
    LocalDaskExecution works perfectly. Thank you.