Table of Contents

Interface IEventService

Namespace
FoundationaLLM.Common.Interfaces
Assembly
FoundationaLLM.Common.dll

Provides services to interact with an eventing engine.

public interface IEventService
Extension Methods

Properties

InitializationTask

Gets the TaskCompletionSource<TResult> (TResult of type bool) that signals the completion of the initialization task.

Task<bool> InitializationTask { get; }

Property Value

Task<bool>

Remarks

The result of the task indicates whether initialization completed successfully or not.

ServiceInstanceName

The name of the service instance.

string ServiceInstanceName { get; }

Property Value

string

Methods

ExecuteAsync(CancellationToken)

Executes the event service until cancellation is signaled.

Task ExecuteAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The CancellationToken signaling cancellation.

Returns

Task

SendEvent(string, CloudEvent)

Sends an event to the event service.

Task SendEvent(string topicName, CloudEvent cloudEvent)

Parameters

topicName string

The name of the topic where the event should be sent.

cloudEvent CloudEvent

The CloudEvent object containing the details of the event.

Returns

Task

StartAsync(CancellationToken)

Starts the event service, allowing it to initialize.

Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The CancellationToken signaling cancellation.

Returns

Task

StopAsync(CancellationToken)

Stops the event service, allowing it to cleanup.

Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The CancellationToken signaling cancellation.

Returns

Task

SubscribeToEventTypeEvent(string, EventTypeEventDelegate)

Adds an event set event delgate to the list of event handlers for a specified event set namespace.

void SubscribeToEventTypeEvent(string eventType, EventTypeEventDelegate eventHandler)

Parameters

eventType string

The event type to subscribe to.

eventHandler EventTypeEventDelegate

The 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.

void UnsubscribeFromEventTypeEvent(string eventType, EventTypeEventDelegate eventHandler)

Parameters

eventType string

The event type to subscribe to.

eventHandler EventTypeEventDelegate

The function to be invoked during event handling.