David N
05/12/2020, 6:01 PMDavid N
05/12/2020, 6:02 PMnicholas
Running
state to finish.David N
05/12/2020, 6:09 PMnicholas
flow.register()
again, no code changes needed)David N
05/12/2020, 6:17 PMwith Flow('flow-name', schedule=schedules.IntervalSchedule(interval=timedelta(seconds=300))) as flow:
t1=func()
t2=func2(t1)
flow.run()
then we execute the python scipt, the process runs "forever", and kicks the flow off every 300 secs.nicholas
David N
05/12/2020, 6:18 PMnicholas
Jim Crist-Harif
05/12/2020, 6:32 PMfilter
or clock
, see https://docs.prefect.io/core/concepts/schedules.html#complex-schedules). You'd want the schedule to respond to some external event (perhaps an os signal, perhaps it starts an http server and waits for a ping, perhaps it watches a file on disk for changes, up to you). When notified, it'd filter any newly scheduled events. Something like (pseudocode):
def myfilter(event):
if shouldnt_schedule_more_runs():
return False
return True
schedule = Schedule(..., filters=[myfilter])
David N
05/12/2020, 7:09 PMDavid N
05/12/2020, 7:09 PM