# GrainCancellationTokenSource Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.graincancellationtokensource/)

## Cancel {#cancel-fae57ed2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.graincancellationtokensource/methods/cancel-fae57ed2/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Cancellation/GrainCancellationTokenSource.cs#L73)

```csharp
public Task Cancel()
```

Communicates a request for cancellation.

### Exceptions

- `System.AggregateException`: An aggregate exception containing all the exceptions thrown by the registered callbacks on the associated [GrainCancellationToken](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.graincancellationtoken/) .
- `System.ObjectDisposedException`: This [GrainCancellationTokenSource](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.graincancellationtokensource/) has been disposed.

## Dispose {#dispose-ff4073da}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.graincancellationtokensource/methods/dispose-ff4073da/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Cancellation/GrainCancellationTokenSource.cs#L84-L85)

```csharp
public void Dispose()
```

Releases the resources used by this `Orleans.Async.GrainCancellationTokenSource`.
