# SiloLifecycleSubject Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.silolifecyclesubject/)

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

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.silolifecyclesubject/methods/onstart-system-threading-cancellationtoken-900a3543/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Lifecycle/SiloLifecycleSubject.cs#L54-L59)

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

## Subscribe(string, int, ILifecycleObserver) {#subscribe-string-int-orleans-ilifecycleobserver-647c8beb}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.silolifecyclesubject/methods/subscribe-string-int-orleans-ilifecycleobserver-647c8beb/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Lifecycle/SiloLifecycleSubject.cs#L102-L104)

```csharp
public override IDisposable Subscribe(string observerName, int stage, ILifecycleObserver observer)
```

Subscribe for notification when a stage is reached while starting or stopping.

### Parameters

- `observerName` (`string`): The name of the observer, for reporting purposes.
- `stage` (`int`): The stage of to subscribe to.
- `observer` (`ILifecycleObserver`): The observer.

### Returns

A disposable that can be disposed of to unsubscribe.
