コード例 #1
0
        protected override IDisposable Subscribe()
        {
            _exceptionStream = new Subject <NumberedException>();

            return(_exceptionStream
                   .Do(OnRawMessage)
                   .Sample(TimeSpanFactory.FromSeconds(2))
                   .ObserveOn(this)
                   .Subscribe(OnNotificationMessage));
        }
コード例 #2
0
        protected override IDisposable Subscribe()
        {
            _exceptionStream = new Subject <BadOrderException>();

            return(_exceptionStream
                   .Do(OnRawMessage)
                   .Buffer(TimeSpanFactory.FromSeconds(2))
                   .Where(g => g.Any())
                   .ObserveOn(this)
                   .Subscribe(g => OnNotificationMessage(BadOrderMessage(g))));
        }
コード例 #3
0
        protected override IDisposable Subscribe()
        {
            _exceptionStream = new Subject <Exception>();

            return(_exceptionStream
                   .Do(OnRawMessage)
                   .Do(ex => IsConnected = false)
                   .Delay(TimeSpanFactory.FromSeconds(3))
                   .SampleResponsive(TimeSpanFactory.FromSeconds(2))
                   .Where(ex => !IsConnected)
                   .ObserveOn(this)
                   .Subscribe(OnNotificationMessage));
        }
コード例 #4
0
        protected override IDisposable Subscribe()
        {
            _exceptionStream = new Subject <Exception>();

            var comparer = new ExceptionEqualityComparer();

            return(_exceptionStream
                   .Do(OnRawMessage)
                   .GroupBy(ex => ex, comparer)
                   .Subscribe(
                       streamOfGivenType =>
                       streamOfGivenType
                       .SampleResponsive(TimeSpanFactory.FromSeconds(2))
                       .ObserveOn(this)
                       .Subscribe(OnNotificationMessage)));
        }