Open rustd opened 9 years ago
Any update on this? Would love to see it in the next release. Thanks!
Can you explain your scenario a bit more and how you're using the shutdown watcher? You're just looking for an easy to use pattern for getting notified when the CancellationToken is actually being cancelled?
Yeah, I have a set of helpers for Application Insights that gather additional data for executing WebJobs, and I want to make sure the data is sent to Azure before the process terminates. Right now AFAIK if you kill the process, the collected data is not sent before the process dies, and you lose the data.
Creating this issue to separate this discussion from https://github.com/Azure/azure-webjobs-sdk/pull/55#issuecomment-147908325 Can you guys please provide examples for how these cancellation options are supposed to work? Also, it would be nice in the WebJobsShutdownWatcher if you guys exposed events for when the shutdown was triggered, not just the cancellation token, so we can handle shutdown gracefully. For example, I need to flush my ApplicationInsights telemetry before the process shuts down. Thanks!