flow-engine icon indicating copy to clipboard operation
flow-engine copied to clipboard

Need a way to timeout a running flow.

Open Chengxuan opened this issue 6 years ago • 0 comments

In IBM App Connect, this lib is the one we've chosen as the framework for our integration executions. To ensure the fairness and control the workload of our back-end system, we set a maximum running time for each integration/flow.

I couldn't find any easy way to achieve that in this lib. Here is my current workaround:

  1. set the expiry time as a global value in the context of the flow before start running the flow.
  2. each task will first check the expiry time in their execute function, if the flow is expired, the task will call flow.fail(TimeoutError) to terminate the flow.
  3. the error event listener will distinguish this special error and tell the user the flow is timed out.

Do you have a better way of achieving this?

Chengxuan avatar Sep 27 '18 07:09 Chengxuan