Home

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

Comments

Sign In or Register to comment.