Package com.naver.ads.deferred
Interface CancellationToken
-
- All Implemented Interfaces:
public interface CancellationTokenPropagates notification that operations should be canceled.
-
-
Method Summary
Modifier and Type Method Description abstract BooleanisCancellationRequested()Returns whether cancellation was requested from the source. abstract CancellationTokenregister(Runnable runnable)Registers a runnable that will be called when this CancellationToken is canceled. -
-
Method Detail
-
isCancellationRequested
abstract Boolean isCancellationRequested()
Returns whether cancellation was requested from the source.
-
register
abstract CancellationToken register(Runnable runnable)
Registers a runnable that will be called when this CancellationToken is canceled. If this token is already in the canceled state, the runnable will be run immediately and synchronously.
- Parameters:
runnable- the runnable to be run when the token is cancelled.- Returns:
a CancellationToken object.
-
-
-
-