InterruptionToken

InterruptionToken class

This class represents the token to use for signaling long running tasks whether the interruption was requested.

getNone

NameDescription
getNone()Represents an empty interruption token. Long-running operations will never be interrupted via InterruptionTokenSource#interrupt when using this token.

Returns: InterruptionToken


isInterruptionRequested

NameDescription
isInterruptionRequested()Returns true if interruption was requested.

Returns: boolean


throwIfInterruptionRequested

NameDescription
throwIfInterruptionRequested()Throws an if interruption was requested.

Error

ErrorCondition
OperationCanceledExceptionThrown when interruption was requested.