Package com.naver.ads.deferred
Class CancellationTokenSource
-
- All Implemented Interfaces:
public final class CancellationTokenSourcePropagates notification that operations should be canceled.
Create an instance of CancellationTokenSource and pass the token returned from token to the asynchronous operation(s). Call cancel to cancel the operations.
A CancellationToken can only be cancelled once - it should not be passed to future operations once cancelled.
-
-
Field Summary
Fields Modifier and Type Field Description private final CancellationTokentoken
-
Constructor Summary
Constructors Constructor Description CancellationTokenSource()
-
Method Summary
Modifier and Type Method Description final CancellationTokengetToken()final Unitcancel()Cancels the runnable if it has not already been cancelled. -
-
Method Detail
-
getToken
final CancellationToken getToken()
-
-
-
-