hofstadter-io / hof

Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.
https://docs.hofstadter.io
Apache License 2.0
510 stars 35 forks source link

hof/flow: can i cancel a running flow? #359

Open lianggengdino opened 8 months ago

lianggengdino commented 8 months ago

Can i cancel a running flow, or pause it? And, can i get a list, that contain all running flow?

verdverm commented 7 months ago

You could probably do these things if you write Go to run the hof/flow

I don't think pausing is something that is easily done, you might have to add your own task type or annotation for that

You should be able to cancel with a ctrl-c from the CLI

verdverm commented 4 months ago

Regarding getting a list, the SDK functions should allow for that, as the underlying cue/flow exposes the task list which has a state field

You can probably get at them from: https://github.com/hofstadter-io/hof/blob/_dev/flow/context/context.go#L37

verdverm commented 3 months ago

Some additional notes

There are --progress and --stats flags to hof flow that will provide extra information

We are pretty close to being able to see the task list and states, including timing information, what we lack is a way to expose this to something like a GUI via an API. Something like OpenTelemetry might be a better option these days. One could add a middleware to send events off to any API