using BotSharp.Abstraction.Observables.Models; using System.Reactive.Subjects; namespace BotSharp.Core.Observables.Queues; public class MessageHub { private readonly ILogger _logger; private readonly ISubject _observable = new Subject(); public IObservable Events => _observable; public MessageHub(ILogger logger) { _logger = logger; } /// /// Push an item to the observers. /// /// public void Push(HubObserveData item) { _observable.OnNext(item); } /// /// Send a complete notification to the observers. /// This will stop the observers from receiving data. /// public void Complete() { _observable.OnCompleted(); } /// /// Send an error notification to the observers. /// This will stop the observers from receiving data. /// /// public void Error(Exception error) { _observable.OnError(error); } }