# ILifecycleObserver Methods

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

## OnStart(CancellationToken) {#onstart-system-threading-cancellationtoken-e37834d3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.ilifecycleobserver/methods/onstart-system-threading-cancellationtoken-e37834d3/)

```csharp
public abstract Task OnStart(CancellationToken cancellationToken = default(CancellationToken))
```

Handle start notifications.

### Parameters

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

### Returns

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

## OnStop(CancellationToken) {#onstop-system-threading-cancellationtoken-665728bd}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.ilifecycleobserver/methods/onstop-system-threading-cancellationtoken-665728bd/)

```csharp
public abstract 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.
