# IDistributedApplicationEventingSubscriber

- Kind: `interface`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Lifecycle`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Lifecycle/IDistributedApplicationEventingSubscriber.cs)

Defines an interface for services that want to subscribe to events from IDistributedApplicationEventing. This allows a service to subscribe to BeforeStartEvent before the application actually starts.

## Definition

```csharp
namespace Aspire.Hosting.Lifecycle;

public interface IDistributedApplicationEventingSubscriber
{
    // ...
}
```

## Methods

- [SubscribeAsync(IDistributedApplicationEventing, DistributedApplicationExecutionContext, CancellationToken)](/reference/api/csharp/aspire.hosting/idistributedapplicationeventingsubscriber/methods.md#subscribeasync-idistributedapplicationeventing-distributedapplicationexecutioncontext-cancellationtoken) : `Task` `abstract` -- Callback during which the service should subscribe to global events from IDistributedApplicationEventing.
