interactive icon indicating copy to clipboard operation
interactive copied to clipboard

Cancelling async operations in the cell

Open craigb opened this issue 3 years ago • 1 comments

The package and version I'm asking about: .NET Interactive © 2020 Microsoft Corporation Version: 1.0.331401+f9a0736070089a9e182a96afc9c0142d2b81e5f5 Library version: 1.0.0-beta.22314.1+f9a0736070089a9e182a96afc9c0142d2b81e5f5 Build date: 2022-06-21T23:40:25.7409383Z https://github.com/dotnet/interactive

Question

Is there access to a cancellation token that's hooked up to the cancel button of the current cell? I have some dumb code that runs for a long time and won't let me cancel it.

craigb avatar Jun 28 '22 22:06 craigb

This should work, though I noticed in testing it that sometimes the Console.WriteLine isn't reached:

image

jonsequitur avatar Jun 29 '22 02:06 jonsequitur