Skip to content

Conversation

@nishkrishnan
Copy link
Collaborator

  • We need to use a disconnected context in the activity to cancel the underlying workflow since the context is canceled at that point
  • We need to return a CanceledError otherwise the UI won't reflect that it's been canceled
  • Set WaitForCallation = true

g.Qual(activityPkg, "RecordHeartbeat").Call(g.Id("ctx"), g.Id("run").Dot("ID").Call()),
),
g.Case(g.Op("<-").Id("ctx").Dot("Done").Call()).Block(
g.List(g.Id("disconnectedCtx"), g.Id("cancel")).Op(":=").Qual("context", "WithTimeout").Call(g.Qual("context", "Background").Call(), g.Qual("time", "Second").Op("*").Lit(5)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a 5 second timeout in particular? Does it make sense for this to be configurable?

@cludden cludden merged commit ec80fd3 into main May 3, 2024
@cludden cludden deleted the nish/support-xns-cancellation branch May 3, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants