CancellationToken.canBeCancelled Method

定义

Specifies if the Cancellation token can be cancelled or not. If the system.fabric.CancellationToken is created using system.fabric.CancellationTokenSource#getToken(), then the token can cancelled using system.fabric.CancellationTokenSource#cancel() method. If the system.fabric.CancellationToken is created using system.fabric.CancellationToken#getDefault(), then it can not be cancelled. It simply acts as a dummy token.

public boolean canBeCancelled()

返回

boolean

Returns true if the token can be cancelled, else false.

适用于