tagged [cancellation-token]
How to use the CancellationToken without throwing/catching an exception?
How to use the CancellationToken without throwing/catching an exception? Compared to the preceding code [for class RulyCanceler](http://www.albahari.com/threading/part3.aspx#_Safe_Cancellation), I wan...
- Modified
- 16 Feb at 01:31
When to dispose CancellationTokenSource?
When to dispose CancellationTokenSource? The class `CancellationTokenSource` is disposable. A quick look in Reflector proves usage of `KernelEvent`, a (very likely) unmanaged resource. Since `Cancella...
- Modified
- 19 Aug at 19:2
Faulted vs Canceled task status after CancellationToken.ThrowIfCancellationRequested
Faulted vs Canceled task status after CancellationToken.ThrowIfCancellationRequested Usually I don't post a question with the answer, but this time I'd like to attract some attention to what I think m...
- Modified
- 23 Dec at 21:31
Linking Cancellation Tokens
Linking Cancellation Tokens I use a cancellation token that is passed around so that my service can be shut down cleanly. The service has logic that keeps trying to connect to other services, so the t...
- Modified
- 14 Apr at 09:14
Why is IsCancellationRequested not set to true on stopping a BackgroundService in .NET Core 3.1?
Why is IsCancellationRequested not set to true on stopping a BackgroundService in .NET Core 3.1? I've read most articles I can find about [IHostApplicationLifetime][1] and CancellationToken's in .NET ...
- Modified
- 1 May at 04:20
Why is the task is not cancelled when I call CancellationTokenSource's Cancel method in async method?
Why is the task is not cancelled when I call CancellationTokenSource's Cancel method in async method? I created a small wrapper around `CancellationToken` and `CancellationTokenSource`. The problem I ...
- Modified
- 22 Jun at 10:56
Cancellation Token Injection
Cancellation Token Injection I'd like to be able to pass cancellation tokens via dependency injection instead of as parameters every time. Is this a thing? We have an asp.net-core 2.1 app, where we pa...
- Modified
- 8 Oct at 15:15