diff --git a/Src/NanoRabbit/DependencyInjection/RabbitSubscriberExtensions.cs b/Src/NanoRabbit/DependencyInjection/RabbitSubscriberExtensions.cs index b1ffd1a..6eb4deb 100644 --- a/Src/NanoRabbit/DependencyInjection/RabbitSubscriberExtensions.cs +++ b/Src/NanoRabbit/DependencyInjection/RabbitSubscriberExtensions.cs @@ -49,25 +49,3 @@ public static IServiceCollection AddRabbitAsyncSubscriber(this return services; } } - -public class CompositeHostedService : IHostedService -{ - private readonly List _hostedServices; - - public CompositeHostedService(List hostedServices) - { - _hostedServices = hostedServices; - } - - public async Task StartAsync(CancellationToken cancellationToken) - { - var tasks = _hostedServices.Select(service => service.StartAsync(cancellationToken)); - await Task.WhenAll(tasks); - } - - public async Task StopAsync(CancellationToken cancellationToken) - { - var tasks = _hostedServices.Select(service => service.StopAsync(cancellationToken)); - await Task.WhenAll(tasks); - } -}