What `AttachExternalCancellation(token)` does?
See original GitHub issueEvery UniTask
instance has a method called AttachExternalCancellation
which takes a cancellation token.
How this method works and when should we use it?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to cancel UniTask.WhenAll()
It has something to do with CancellationTokenSource but I cannot understand how to use it ... AttachExternalCancellation(cancellationToken);.
Read more >c# - Linking Cancellation Tokens
If the Master Token is cancelled, the Temporary Token must also be cancelled. When the Temporary Token expires it must NOT cancel the...
Read more >Why cancelling the token freezes the app? : r/Unity3D
The first operation in internet connection checkout, if there's no internet, all operations should be cancelled. But cancelling them freezes the ...
Read more >CancellationTokenSource.CreateLinkedTokenSource ...
Creates a CancellationTokenSource that will be in the canceled state when any of the source tokens in the specified array are in the...
Read more >DCL.GifDecoderProcessor - Coverage Report
// the processing of gifs whether im close or looking at them like GLFTs. 45, 80, await UniTask.WaitUntil(() => isRunning == false, cancellationToken:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
inside of UniTask.Create is internal task, external cancellation does not stop it as document described.
In the example you have a method (the lambda) that itself is awaiting tasks (delay). then you have the outer method that is creating a task wrapping the lambda.
if you attach an external cancellation, the outer method is allowed to continue and handle the cancelled operation, however the lambda and any tasks awaited on within do not get the cancellationToken and thus cannot be cancelled this way.
@neuecc I am curious if this is a good way to use a UniTaskCancellationSource that is awaited by multiple users which each want to abort waiting on it at different times?