Class AzureEventGridEventService
- Namespace
 - FoundationaLLM.Common.Services.Events
 
- Assembly
 - FoundationaLLM.Common.dll
 
Provides services to integrate with the Azure Event Grid eventing platform.
public class AzureEventGridEventService : IEventService
  - Inheritance
 - 
      
      AzureEventGridEventService
 
- Implements
 
- Inherited Members
 
- Extension Methods
 
Constructors
AzureEventGridEventService(IOptions<InstanceSettings>, DependencyInjectionContainerSettings, IOptions<AzureEventGridEventServiceSettings>, IOptions<AzureEventGridEventServiceProfile>, IAzureResourceManagerService, IHttpClientFactoryService, ILogger<AzureEventGridEventService>)
Creates a new instance of the AzureEventGridEventService event service.
public AzureEventGridEventService(IOptions<InstanceSettings> instanceOptions, DependencyInjectionContainerSettings dependencyInjectionContainerSettings, IOptions<AzureEventGridEventServiceSettings> settingsOptions, IOptions<AzureEventGridEventServiceProfile> profileOptions, IAzureResourceManagerService azureResourceManager, IHttpClientFactoryService httpClientFactory, ILogger<AzureEventGridEventService> logger)
  Parameters
instanceOptionsIOptions<InstanceSettings>The FoundationaLLM instance-level settings.
dependencyInjectionContainerSettingsDependencyInjectionContainerSettingsThe DependencyInjectionContainerSettings providing the configuration of the dependency injection container.
settingsOptionsIOptions<AzureEventGridEventServiceSettings>The options providing the settings for the service.
profileOptionsIOptions<AzureEventGridEventServiceProfile>The options providing the profile for the service.
azureResourceManagerIAzureResourceManagerServiceThe IAzureResourceManagerService service providing access to Azure ARM services.
httpClientFactoryIHttpClientFactoryServiceThe IHttpClientFactoryService service used to create HTTP clients.
loggerILogger<AzureEventGridEventService>The logger used for logging.
Properties
InitializationTask
Gets the TaskCompletionSource<TResult> (TResult of type bool)
that signals the completion of the initialization task.
public Task<bool> InitializationTask { get; }
  Property Value
Remarks
The result of the task indicates whether initialization completed successfully or not.
ServiceInstanceName
The name of the service instance.
public string ServiceInstanceName { get; }
  Property Value
Methods
ExecuteAsync(CancellationToken)
Executes the event service until cancellation is signaled.
public Task ExecuteAsync(CancellationToken cancellationToken)
  Parameters
cancellationTokenCancellationTokenThe CancellationToken signaling cancellation.
Returns
SendEvent(string, CloudEvent)
Sends an event to the event service.
public Task SendEvent(string topicName, CloudEvent cloudEvent)
  Parameters
topicNamestringThe name of the topic where the event should be sent.
cloudEventCloudEventThe CloudEvent object containing the details of the event.
Returns
StartAsync(CancellationToken)
Starts the event service, allowing it to initialize.
public Task StartAsync(CancellationToken cancellationToken)
  Parameters
cancellationTokenCancellationTokenThe CancellationToken signaling cancellation.
Returns
StopAsync(CancellationToken)
Stops the event service, allowing it to cleanup.
public Task StopAsync(CancellationToken cancellationToken)
  Parameters
cancellationTokenCancellationTokenThe CancellationToken signaling cancellation.
Returns
SubscribeToEventTypeEvent(string, EventTypeEventDelegate)
Adds an event set event delgate to the list of event handlers for a specified event set namespace.
public void SubscribeToEventTypeEvent(string eventType, EventTypeEventDelegate eventHandler)
  Parameters
eventTypestringThe event type to subscribe to.
eventHandlerEventTypeEventDelegateThe function to be invoked during event handling.
UnsubscribeFromEventTypeEvent(string, EventTypeEventDelegate)
Removes an event set event delegate from the list of event handlers for a specified event set namespace.
public void UnsubscribeFromEventTypeEvent(string eventType, EventTypeEventDelegate eventHandler)
  Parameters
eventTypestringThe event type to subscribe to.
eventHandlerEventTypeEventDelegateThe function to be invoked during event handling.