public IDisposable Subscribe(IMessagesStreamObserver observer) { var subscription = new Subscription(observer ?? throw new ArgumentNullException(nameof(observer))); _subscriptions.Add(subscription); return(subscription); }
/// <inheritdoc /> public IDisposable Subscribe(IMessagesStreamObserver observer) { if (observer == null) { throw new ArgumentNullException(nameof(observer)); } return(_subject.Subscribe(observer)); }
public Subscription([NotNull] IMessagesStreamObserver observer) { IsDisposed = false; Observer = observer; }