Closed JanEggers closed 3 years ago
I have checked rabbitmq-dotnet-client project and It seems like there is no cancellation token support at all 😞
As for other suggestions, in that pull request I add hosted service
public class ConsumingHostedService : IHostedService
{
private readonly IConsumingService _consumingService;
public ConsumingHostedService(IConsumingService consumingService)
{
_consumingService = consumingService;
}
public Task StartAsync(CancellationToken cancellationToken)
{
_consumingService.StartConsuming();
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
}
and it don't have to explain the code.
in our current project we wrap the IConsumingService because it is no IHostedService. so it does not start automaticly.
why has the api been designed that way?
why no cancellation token support?
another issue I have is that the connections are established by the ctor. I would really prefere that this would be done on first usage.