Offer Cooperative Cancellation
Support for cooperative cancellation would ease graceful and highly reactive shutdown. It should allow to cancel out of processing and waits.
Thanks for the feedback – can you provide any more detail on how this may be more than the “cancel a workflow” function in the current API? https://msdn.microsoft.com/en-US/library/azure/dn948513.aspx
Peter Meinl commented
I wrote this suggestion together with [Offer a polling loop](http://feedback.azure.com/forums/287593-logic-apps/suggestions/8176815-offer-a-polling-loop?tracking_code=b224f5b31fb57b3018d342b5362d3140). When using a loop one needs to implement a delay to prevent monopolizing a complete CPU when idling. In addition to the loop itselft the delay needs to be cancellable.
I was not aware of the existing "cancel a workflow" function and from the documentation am unable to judge if it offers what is needed. The CancellationToken offered with TPL is a good example for cooperative cancellation. In the loop case above on could use _ct.ThrowIfCancellationRequested() to cancel the loop await Taks.Delay(_pollInterval, _ct) to cancel the wait.