Code
import time
from prefect import task, flow
from prefect.task_runners import SequentialTaskRunner
@task
def print_values(values):
for value in values:
time.sleep(0.5)
print(value, end="\r")
@flow(task_runner=SequentialTaskRunner())
def my_flow():
print_values.submit(["AAAA"] * 15)
print_values.submit(["BBBB"] * 10)
if __name__ == "__main__":
my_flow()
08:58:23.840 | INFO | prefect.engine - Created flow run 'fabulous-honeybee' for flow 'my-flow'
08:58:24.073 | INFO | Flow run 'fabulous-honeybee' - Created task run 'print_values-0' for task 'print_values'
08:58:24.076 | INFO | Flow run 'fabulous-honeybee' - Executing 'print_values-0' immediately...
08:58:31.689 | INFO | Task run 'print_values-0' - Finished in state Completed()
08:58:31.723 | INFO | Flow run 'fabulous-honeybee' - Created task run 'print_values-1' for task 'print_values'
08:58:31.725 | INFO | Flow run 'fabulous-honeybee' - Executing 'print_values-1' immediately...
08:58:36.821 | INFO | Task run 'print_values-1' - Finished in state Completed()
08:58:36.857 | INFO | Flow run 'fabulous-honeybee' - Finished in state Completed('All states completed.')