using System.Reactive; using Serilog; namespace TwitchChatTTS.Bus { public class ServiceBusObserver : ObserverBase { private readonly Action _action; private readonly ILogger _logger; public ServiceBusObserver(Action action, ILogger logger) { _action = action; _logger = logger; } protected override void OnCompletedCore() { } protected override void OnErrorCore(Exception error) { _logger.Error(error, "Error occurred."); } protected override void OnNextCore(ServiceBusData value) { _action.Invoke(value); } } }