Share via


InitializeResourceEvent Constructor

Definition

This event is raised by orchestrators to signal to resources that they should initialize themselves.

public InitializeResourceEvent(Aspire.Hosting.ApplicationModel.IResource resource, Aspire.Hosting.Eventing.IDistributedApplicationEventing distributedApplicationEventing, Aspire.Hosting.ApplicationModel.ResourceLoggerService resourceLoggerService, Aspire.Hosting.ApplicationModel.ResourceNotificationService resourceNotificationService, IServiceProvider services);
new Aspire.Hosting.ApplicationModel.InitializeResourceEvent : Aspire.Hosting.ApplicationModel.IResource * Aspire.Hosting.Eventing.IDistributedApplicationEventing * Aspire.Hosting.ApplicationModel.ResourceLoggerService * Aspire.Hosting.ApplicationModel.ResourceNotificationService * IServiceProvider -> Aspire.Hosting.ApplicationModel.InitializeResourceEvent
Public Sub New (resource As IResource, distributedApplicationEventing As IDistributedApplicationEventing, resourceLoggerService As ResourceLoggerService, resourceNotificationService As ResourceNotificationService, services As IServiceProvider)

Parameters

resource
IResource

The resource that is being created.

distributedApplicationEventing
IDistributedApplicationEventing

The IDistributedApplicationEventing service for the app host.

resourceLoggerService
ResourceLoggerService

The ResourceLoggerService for the app host.

resourceNotificationService
ResourceNotificationService

The ResourceNotificationService for the app host.

services
IServiceProvider

The IServiceProvider for the app host.

Remarks

Custom resources can subscribe to this event to perform initialization tasks, including starting background tasks that manage the resource's lifecycle.

Applies to