# IDurableTaskCompletionSource&lt;T&gt; Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.idurabletaskcompletionsource-1/)

## TrySetCanceled {#trysetcanceled-ad10c109}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.idurabletaskcompletionsource-1/methods/trysetcanceled-ad10c109/)

```csharp
public abstract bool TrySetCanceled()
```

Attempts to transition the durable state to canceled.

### Returns

`true` if the state was transitioned; otherwise, `false`.

## TrySetException(Exception) {#trysetexception-system-exception-d74cf2e5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.idurabletaskcompletionsource-1/methods/trysetexception-system-exception-d74cf2e5/)

```csharp
public abstract bool TrySetException(Exception exception)
```

Attempts to transition the durable state to faulted with the specified exception.

### Parameters

- `exception` (`Exception`): The exception which faults the task.

### Returns

`true` if the state was transitioned; otherwise, `false`.

## TrySetResult(T) {#trysetresult-t-a0f93a9c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.idurabletaskcompletionsource-1/methods/trysetresult-t-a0f93a9c/)

```csharp
public abstract bool TrySetResult(T value)
```

Attempts to transition the durable state to completed with the specified result.

### Parameters

- `value` (`T`): The task result.

### Returns

`true` if the state was transitioned; otherwise, `false`.
