# LifecycleSubject.OnStop(CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.lifecyclesubject/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.lifecyclesubject/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Lifecycle/LifecycleSubject.cs#L157-L187)

```csharp
public virtual Task OnStop(CancellationToken cancellationToken = default(CancellationToken))
```

Handle stop notifications.

### Parameters

- `cancellationToken` (`CancellationToken`): The cancellation token which indicates that the operation should be stopped promptly when it is canceled.

### Returns

A `System.Threading.Tasks.Task` which represents the operation.
