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))));
        }
        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)));
        }