https://prefect.io logo
Title
m

Michael Reynolds

07/26/2022, 3:11 PM
are there docs or examples that demonstrate how to use
orion
for non-terminating long running workflows?
1
a

Anna Geller

07/26/2022, 3:20 PM
kind of - you may try this approach with a while loop https://medium.com/p/1737c80da3f5
there are lots of cons of long-running flows, I described pros and cons in this post
m

Michael Reynolds

07/26/2022, 3:25 PM
awesome thanks
🙌 1
to make sure i understand correctly, i haven't read through the post yet i have some other stuff to take care of this morning first...
but you would advise against something like this?
@task
def my_listen_task():
	pass

@task
def my_process_task(data):
	pass

@task
def my_persistence_task(data):
	pass

@flow
def my_flow():
	while True:
		updates = my_listen_task()
		results = my_process_task(updates)

		if len(results) > 0:
			my_persistence_task(results)


if __name__ == '__main__':
	run_pipeline()
a

Anna Geller

07/26/2022, 9:32 PM
Yes exactly, the post explains why I think it's a bad idea
m

Michael Reynolds

07/27/2022, 7:49 PM
gotcha thanks
🙌 1