你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
CancellationTokenSource Class
- java.
lang. Object - system.
fabric. CancellationTokenSource
- system.
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. |
Cancellation |
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: