コード例 #1
0
 public void ForwardOnNext(int value)
 {
     _parent._consumer.ForwardOnNext(value);
     if (_errorReenter)
     {
         HalfSerializer.ForwardOnError(this, X, ref _parent._wip, ref _parent._error);
     }
     else
     {
         HalfSerializer.ForwardOnCompleted(this, ref _parent._wip, ref _parent._error);
     }
 }
コード例 #2
0
 public void ForwardOnNext(int value)
 {
     parent.consumer.ForwardOnNext(value);
     if (errorReenter)
     {
         HalfSerializer.ForwardOnError(this, x, ref parent.wip, ref parent.error);
     }
     else
     {
         HalfSerializer.ForwardOnCompleted(this, ref parent.wip, ref parent.error);
     }
 }
コード例 #3
0
        public void HalfSerializer_OnError()
        {
            var ex = new InvalidOperationException();

            HalfSerializer.ForwardOnError(_consumer, ex, ref _wip, ref _error);

            Assert.Equal(1, _wip);
            Assert.Equal(_error, ExceptionHelper.Terminated);

            HalfSerializer.ForwardOnNext(_consumer, 2, ref _wip, ref _error);

            Assert.Equal(0, _consumer.Items.Count);
            Assert.Equal(0, _consumer.Done);
            Assert.Equal(ex, _consumer.Exc);
        }
コード例 #4
0
        public void HalfSerializer_OnError()
        {
            var ex = new InvalidOperationException();

            HalfSerializer.ForwardOnError(consumer, ex, ref wip, ref error);

            Assert.Equal(1, wip);
            Assert.Equal(error, ExceptionHelper.Terminated);

            HalfSerializer.ForwardOnNext(consumer, 2, ref wip, ref error);

            Assert.Equal(0, consumer.items.Count);
            Assert.Equal(0, consumer.done);
            Assert.Equal(ex, consumer.exc);
        }
コード例 #5
0
        public void HalfSerializer_OnCompleted_Ignore_Further_Events()
        {
            HalfSerializer.ForwardOnCompleted(_consumer, ref _wip, ref _error);

            Assert.Equal(1, _wip);
            Assert.Equal(_error, ExceptionHelper.Terminated);

            HalfSerializer.ForwardOnNext(_consumer, 2, ref _wip, ref _error);
            var ex2 = new NotSupportedException();

            HalfSerializer.ForwardOnError(_consumer, ex2, ref _wip, ref _error);
            HalfSerializer.ForwardOnCompleted(_consumer, ref _wip, ref _error);

            Assert.Equal(0, _consumer.Items.Count);
            Assert.Equal(1, _consumer.Done);
            Assert.Null(_consumer.Exc);
        }
コード例 #6
0
        public void HalfSerializer_OnError_Ignore_Further_Events()
        {
            var ex = new InvalidOperationException();

            HalfSerializer.ForwardOnError(consumer, ex, ref wip, ref error);

            Assert.Equal(1, wip);
            Assert.Equal(error, ExceptionHelper.Terminated);

            HalfSerializer.ForwardOnNext(consumer, 2, ref wip, ref error);
            var ex2 = new NotSupportedException();

            HalfSerializer.ForwardOnError(consumer, ex2, ref wip, ref error);
            HalfSerializer.ForwardOnCompleted(consumer, ref wip, ref error);

            Assert.Equal(0, consumer.items.Count);
            Assert.Equal(0, consumer.done);
            Assert.Equal(ex, consumer.exc);
        }
コード例 #7
0
 public void OnError(Exception error)
 {
     HalfSerializer.ForwardOnError(_parent, error, ref _parent._halfSerializer, ref _parent._error);
 }
コード例 #8
0
 public override void OnError(Exception ex)
 {
     HalfSerializer.ForwardOnError(this, ex, ref _halfSerializer, ref _error);
 }
コード例 #9
0
 public void OnError(Exception error)
 {
     HalfSerializer.ForwardOnError(this, error, ref _halfSerializer, ref _error);
 }
コード例 #10
0
 private void HandlerError(Exception error)
 {
     HalfSerializer.ForwardOnError(this, error, ref _halfSerializer, ref _error);
 }
コード例 #11
0
 internal void HandlerError(Exception error)
 {
     HalfSerializer.ForwardOnError(this, error, ref halfSerializer, ref this.error);
 }