/// <summary> /// Enumerate the connections invoking the callback for each connection /// </summary> /// <param name="callback">The callback</param> /// <returns>An awaitable Task for the operation</returns> public void Notify(ObserverNotification callback) { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } if (_connections.Count == 0) { return; } foreach (Handle observer in _connections.Values) { observer.Notify(callback); } }
public static Recorded <INotification <T> > OnCompleted <T>(long ticks) { return(new Recorded <INotification <T> >(ticks, ObserverNotification.CreateOnCompleted <T>())); }
public static Recorded <INotification <T> > OnError <T>(long ticks, Func <Exception, bool> predicate) { return(new Recorded <INotification <T> >(ticks, ObserverNotification.CreateOnError <T>(predicate))); }
public static Recorded <INotification <T> > OnError <T>(long ticks, Exception error) { return(new Recorded <INotification <T> >(ticks, ObserverNotification.CreateOnError <T>(error))); }
public static Recorded <INotification <T> > OnNext <T>(long ticks, T value) { return(new Recorded <INotification <T> >(ticks, ObserverNotification.CreateOnNext <T>(value))); }
public void OnCompleted() { _messageRouter.Publish(_topic, ObserverNotification.CreateOnCompleted <byte[]>()); }
public void OnError(Exception error) { _messageRouter.Publish(_topic, ObserverNotification.CreateOnError <byte[]>(error)); }
public void OnNext(TSource value) { var serialized = _serializer.ToBytes(value); _messageRouter.Publish(_topic, ObserverNotification.CreateOnNext <byte[]>(serialized)); }
public void Notify(ObserverNotification notification) { notification(_observer); }