You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The console output "Dispose" does not appear when the following code is canceled.
usingSystem.Threading.Tasks;usingMicrosoft.DotNet.Interactive;Console.WriteLine("initialize");varoutput=string.Empty.Display("text/plain");varcounter=1;while(!KernelInvocationContext.Current.CancellationToken.IsCancellationRequested){awaitTask.Delay(500);output.Update($"{counter++}");}Console.WriteLine("Dispose");varcompleted=true;
```
Thisisbecause the `KernelInvocationContext` stops listening to console output and publishingeventswhen it's completed.Thebehaviorisunintuitivethough and could perhaps be changed so that eventpublishing continues for long enoughto capture thisoutput.Moredetailshere:https://github.com/dotnet/interactive/issues/2987#issuecomment-2489136012
The text was updated successfully, but these errors were encountered:
The console output
"Dispose"
does not appear when the following code is canceled.The text was updated successfully, but these errors were encountered: