コード例 #1
0
 /// <summary>
 /// Observes the events of a given name.
 /// </summary>
 public static IObservable <T> OfName <T>(
     this IEventStream eventStream,
     string name)
 {
     return(eventStream
            .OfNamedString <T>(name)
            .Retry()
            .Select(_ => _.Payload));
 }
コード例 #2
0
        /// <summary>
        /// Observes the events of a given name.
        /// </summary>
        public static IDisposable OfName <T>(
            this IEventStream eventStream,
            string name,
            Action <T> onNext)
        {
            if (onNext == null)
            {
                return(Disposable.Empty);
            }

            return(eventStream
                   .OfNamedString <T>(name)
                   .Select(_ => _.Payload)
                   .Retry()
                   .Subscribe(onNext: onNext));
        }