简体   繁体   中英

Is there a mechanism to signal the workflow immediately about the failure/time-out of an asynchronous activity

We want to implement a use-case using cadence-workflow where we want to trigger a long-running asynchronous activity and then proceed with the execution of other activities. If in the meantime, for some reason that long-running activity is failed/timed-out, we would like to stop execution of the workflow and trigger compensation activities.

When an activity is invoked asynchronously it returns its result as Future (in Go SDK) or Promise (in Java SDK). Then the rest of the workflow can proceed without waiting on the result. The result can be used to cancel the other part of the workflow code when the activity fails or times out. When cancelled the code can execute whatever cleanup logic necessary. The concrete implementation depends on which SDK you are using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM