When clicking stop query, how to propagate CancellationToken
Hi,
Is it possible to do something like this?
async Task Main(CancellationToken token= default(CancellationToken))
{
// and when I press cancel on the LINQPad interface, it passing the cancelling request down
await SomeExternalLibCall(token);
}
That doesn't work. Is there an internal helper CancellationToken that work with the cancel button that I can use?
Currently, best I can do roll my own token source with a Timespan.
Thank you,
Art
Is it possible to do something like this?
async Task Main(CancellationToken token= default(CancellationToken))
{
// and when I press cancel on the LINQPad interface, it passing the cancelling request down
await SomeExternalLibCall(token);
}
That doesn't work. Is there an internal helper CancellationToken that work with the cancel button that I can use?
Currently, best I can do roll my own token source with a Timespan.
Thank you,
Art
Comments
Util.Cleanup += (sender, args) => ...
This fires just before the query is re-run or closed, and can be used to cancel any outstanding activity from the previous execution.