using Microsoft.Extensions.DependencyInjection;
using Svrnty.CQRS.Events.Abstractions.Notifications;
using Svrnty.CQRS.Events.Abstractions.Delivery;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Svrnty.CQRS.Events.Abstractions;
namespace Svrnty.CQRS.Events.Grpc;
///
/// Service collection extensions for gRPC event streaming.
///
public static class ServiceCollectionExtensions
{
///
/// Add gRPC event streaming support.
/// Requires Grpc.AspNetCore to be configured in the application.
///
///
///
/// Phase 1.7:
/// Registers the gRPC event delivery provider for push-based streaming.
///
///
public static IServiceCollection AddSvrntyEventsGrpc(this IServiceCollection services)
{
// EventServiceImpl is registered as a singleton so we can access the static notification method
services.AddSingleton();
// Register the gRPC event notifier (legacy)
services.TryAddSingleton();
// Phase 1.7: Register gRPC event delivery provider
services.TryAddSingleton();
return services;
}
}