# IScheduledTaskHandle Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/)

## AbortAsync(string, CancellationToken) {#abortasync-string-system-threading-cancellationtoken-bcee1c0c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/methods/abortasync-string-system-threading-cancellationtoken-bcee1c0c/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/ISchedulableTask.cs#L101)

```csharp
public virtual ValueTask AbortAsync(string reason, CancellationToken cancellationToken)
```

Administratively aborts the task: the host terminalizes it and its attached descendants as failed with [DurableTaskAbortedException](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskabortedexception/), without running further task code. The token abandons waiting for acknowledgement.

### Parameters

- `reason` (`string`): The reason for the abort, recorded as the exception message.
- `cancellationToken` (`CancellationToken`): A token which abandons waiting for the abort to commit.

## CancelAsync(string?, CancellationToken) {#cancelasync-string-nullable-system-threading-cancellationtoken-53bdac30}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/methods/cancelasync-string-nullable-system-threading-cancellationtoken-53bdac30/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/ISchedulableTask.cs#L71)

```csharp
public abstract ValueTask CancelAsync(string? reason, CancellationToken cancellationToken)
```

Durably requests task cancellation carrying `reason`. The request is monotonic and idempotent. The token abandons waiting for acknowledgement.

### Parameters

- `reason` (`string?`): The reason which the task's [DurableTaskContext](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskcontext/) reports, or `null` for none.
- `cancellationToken` (`CancellationToken`): A token which abandons waiting for the request to commit.

## CancelAsync(CancellationToken) {#cancelasync-system-threading-cancellationtoken-e5e89fbb}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/methods/cancelasync-system-threading-cancellationtoken-e5e89fbb/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/ISchedulableTask.cs#L71)

```csharp
public virtual ValueTask CancelAsync(CancellationToken cancellationToken)
```

Durably requests task cancellation without a reason. The request is monotonic and idempotent. The token abandons waiting for acknowledgement.

### Parameters

- `cancellationToken` (`CancellationToken`)

## GetFeature {#getfeature-1-58ffa18c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/methods/getfeature-1-58ffa18c/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/ISchedulableTask.cs#L52)

```csharp
public virtual TFeature? GetFeature<TFeature>()
```

Returns the feature `TFeature` through which the host describes the task, or `null`; see [ScheduledTask](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.scheduledtask/).

## PollAsync(PollingOptions, CancellationToken) {#pollasync-orleans-durable-tasks-pollingoptions-system-threading-cancellationtoke-1589c161}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/methods/pollasync-orleans-durable-tasks-pollingoptions-system-threading-cancellationtoke-1589c161/)

```csharp
public abstract ValueTask<DurableTaskResponse> PollAsync(PollingOptions options, CancellationToken cancellationToken)
```

Observes the current response. Canceling `cancellationToken` cancels this poll.

### Parameters

- `options` (`PollingOptions`)
- `cancellationToken` (`CancellationToken`)

## WaitAsync(CancellationToken) {#waitasync-system-threading-cancellationtoken-e3fe0cf0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.ischeduledtaskhandle/methods/waitasync-system-threading-cancellationtoken-e3fe0cf0/)

```csharp
public abstract ValueTask<DurableTaskResponse> WaitAsync(CancellationToken cancellationToken)
```

Waits for a terminal response. Canceling `cancellationToken` cancels this wait.

### Parameters

- `cancellationToken` (`CancellationToken`)
