using Microsoft.Extensions.Logging;
using NBB.Messaging.Abstractions;
using System.Threading;
using System.Threading.Tasks;

namespace NetworkResurrector.Api.Services
{
    internal class EmptyMessageBusPublisher : IMessageBusPublisher
    {
        private readonly ILogger<EmptyMessageBusPublisher> _logger;

        public EmptyMessageBusPublisher(ILogger<EmptyMessageBusPublisher> logger)
        {
            _logger=logger;
        }

        public Task PublishAsync<T>(T message, MessagingPublisherOptions publisherOptions = null, CancellationToken cancellationToken = default)
        {
            _logger.LogDebug($"EmptyMessageBusPublisher: Message {message.GetType().FullName} was published.");
            return Task.CompletedTask;
        }
    }
}
