public class CancellationToken
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static CancellationToken |
NONE
A CancellationToken that can be used as a placeholder for "no token to pass".
|
| Constructor and Description |
|---|
CancellationToken()
Creates a new instance of the CancellationToken class.
|
| Modifier and Type | Method and Description |
|---|---|
<T> void |
register(java.util.concurrent.CompletableFuture<T> future)
Registers the given Future to the token.
|
void |
requestCancellation()
Cancels all registered futures.
|
java.lang.String |
toString() |
public static final CancellationToken NONE
public CancellationToken()
public <T> void register(java.util.concurrent.CompletableFuture<T> future)
T - Return type of the future.future - The Future to register.public void requestCancellation()
public java.lang.String toString()
toString in class java.lang.Object