Skip to content

Why not just write it as wfexec.NewSession(execCtx, s.graph, opts...) #418

Answered by darh
showntop asked this question in Q&A
Discussion options

You must be logged in to vote

not quite clear what the question is :)

We need to create wf session in the background, detached from the current (request) context and "bind it" to the main app context.
Main reason is having more control over when session is canceled.
First, we do not want to be a victim of prematurely canceled HTTP request that invoked the session. Second we want to terminate sessions on server shutdown.

Hope this helps.

I'm sure there are other approaches that address this particular challange.

If you have a suggestion how to rewrite the explanation above spawn() fn I'm happy to replace it.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by darh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants