Aracılığıyla paylaş


CancellationTokenSource Class

  • java.lang.Object
    • system.fabric.CancellationTokenSource

public class CancellationTokenSource

A CancellationTokenSource is used to create CancellationToken object and manage it.

Constructor Summary

Constructor Description
CancellationTokenSource()

Initializes a new instance of the system.fabric.CancellationTokenSource class.

Method Summary

Modifier and Type Method and Description
void cancel()

Requests cancel on the CancellationToken being managed by this object.

CancellationToken getToken()

Returns the cancellation token which is being by this system.fabric.CancellationTokenSource object.

boolean isCancellationRequested()

Gets whether cancellation has been requested for this system.fabric.CancellationTokenSource.

Constructor Details

CancellationTokenSource

public CancellationTokenSource()

Initializes a new instance of the system.fabric.CancellationTokenSource class.

Method Details

cancel

public void cancel()

Requests cancel on the CancellationToken being managed by this object.

getToken

public CancellationToken getToken()

Returns the cancellation token which is being by this system.fabric.CancellationTokenSource object.

Returns:

isCancellationRequested

public boolean isCancellationRequested()

Gets whether cancellation has been requested for this system.fabric.CancellationTokenSource.

Returns:

Whether cancellation has been requested for this system.fabric.CancellationTokenSource.

Applies to