How are continuations dealing with crashes and App Pool shutdowns? In the release notes to 1.4.0, you say:
continuation will be enqueued after parent job completion
So in the example:
var jobId = BackgroundJob.Enqueue(() => Console.Write("Hello, "));
BackgroundJob.ContinueWith(jobId, () => Console.WriteLine("world!"));
is the second job persisted anywhere? And what would be its state before it gets enqueued when the first job finishes?
Looking at the 1.4.0 dashboard, I guess these are the Awaiting jobs. Please correct me if I’m wrong.
Yes, the whole graph is persistent. Continuations are created in the
Awaiting state, so they are regular background jobs.
Thanks. Excellent. Of course, something can still go wrong between the Enqueue and ContinueWith calls and then the continuation jobs wouldn’t be persisted.
Of course, but will be an exception your application can catch and provide the fallback logic.