Exemplo n.º 1
0
        void Signal(PublisherSwitchMapSubscriber sender, R value, bool done)
        {
            if (Volatile.Read(ref index) != sender.Index())
            {
                if (done)
                {
                    Exception e = sender.Error();

                    if (e != null)
                    {
                        RxAdvancedFlowPlugins.OnError(e);
                    }
                }
                return;
            }

            PublisherSwitchMapStruct s = new PublisherSwitchMapStruct();

            s.sender = sender;
            s.value  = value;
            s.done   = done;

            lock (this)
            {
                q.OfferRef(ref s);
            }

            if (done)
            {
                sender.SetDone();
            }

            Drain();
        }
Exemplo n.º 2
0
 void AddError(Exception e)
 {
     if (!ExceptionHelper.Add(ref error, e))
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 3
0
 public void OnError(Exception e)
 {
     if (done)
     {
         RxAdvancedFlowPlugins.OnError(e);
         return;
     }
     actual.OnError(e);
 }
Exemplo n.º 4
0
            public void OnError(Exception e)
            {
                if (done)
                {
                    RxAdvancedFlowPlugins.OnError(e);
                    return;
                }

                parent.Error(e, index);
            }
Exemplo n.º 5
0
 public void OnError(Exception error)
 {
     if (mode == 2)
     {
         RxAdvancedFlowPlugins.OnError(error);
         return;
     }
     mode = 2;
     actual.OnError(error);
 }
Exemplo n.º 6
0
 public void OnError(Exception e)
 {
     if (IncrementIndex())
     {
         actual.OnError(e);
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 7
0
 void PostCleanup()
 {
     try
     {
         PreCleanup();
     }
     catch (Exception e)
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 8
0
 public void OnError(Exception e)
 {
     if (index >= 0L)
     {
         actual.OnError(e);
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 9
0
 void Error(Exception e, long index)
 {
     if (Volatile.Read(ref this.index) == index)
     {
         actual.OnError(e);
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 10
0
 public void OnError(Exception e)
 {
     if (count < 2)
     {
         actual.OnError(e);
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 11
0
 public void Subscribe(ICompletableSubscriber s)
 {
     try
     {
         onSubscribe(s);
     }
     catch (Exception e)
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
 void DoAfterTerminated()
 {
     try
     {
         onAfterTerminateCall();
     }
     catch (Exception e)
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 13
0
 public void Subscribe(ISubscriber <T> s)
 {
     try
     {
         action(s);
     }
     catch (Exception ex)
     {
         RxAdvancedFlowPlugins.OnError(ex);
     }
 }
 public void OnError(Exception e)
 {
     try
     {
         onErrorCall(e);
     }
     catch (Exception ex)
     {
         RxAdvancedFlowPlugins.OnError(new AggregateException(e, ex));
     }
 }
 public void OnComplete()
 {
     try
     {
         onCompleteCall();
     }
     catch (Exception e)
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 16
0
 void DoTerminate()
 {
     try
     {
         onTerminated();
     }
     catch (Exception e)
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 17
0
 public void InnerError(Exception e, PublisherZipInnerSupport inner)
 {
     if (ExceptionHelper.Add(ref error, e))
     {
         inner.SetDone();
         Drain();
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
        public void OnError(Exception e)
        {
            if (doneOverflow)
            {
                RxAdvancedFlowPlugins.OnError(e);
                return;
            }

            error = e;
            Volatile.Write(ref done, true);
            Drain();
        }
Exemplo n.º 19
0
 public IDisposable Subscribe(IObserver <T> observer)
 {
     try
     {
         return(onSubscribe(observer));
     }
     catch (Exception ex)
     {
         RxAdvancedFlowPlugins.OnError(ex);
         return(EmptyDisposable.Instance);
     }
 }
Exemplo n.º 20
0
 public void OnError(Exception e)
 {
     if (Interlocked.Exchange(ref wip, 0) > 0)
     {
         all.Dispose();
         actual.OnError(e);
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
 public void OnError(Exception e)
 {
     if (Interlocked.CompareExchange(ref once, 1, 0) == 0)
     {
         all.Dispose();
         actual.OnError(e);
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
 public void OnError(Exception e)
 {
     if (ExceptionHelper.Add(ref error, e))
     {
         Volatile.Write(ref done, true);
         Drain();
     }
     else
     {
         RxAdvancedFlowPlugins.OnError(e);
     }
 }
Exemplo n.º 23
0
        public void Request(long n)
        {
            try
            {
                onRequestCall?.Invoke(n);
            }
            catch (Exception e)
            {
                RxAdvancedFlowPlugins.OnError(e);
            }

            s.Request(n);
        }
Exemplo n.º 24
0
        public void OnNext(T t)
        {
            try
            {
                onNextCall?.Invoke(t);
            }
            catch (Exception e)
            {
                RxAdvancedFlowPlugins.OnError(e);
            }

            actual.OnNext(t);
        }
Exemplo n.º 25
0
        void TimeoutError(Exception e, long index)
        {
            if (CasIndex(index))
            {
                arbiter.Cancel();

                actual.OnError(e);
            }
            else
            {
                RxAdvancedFlowPlugins.OnError(e);
            }
        }
Exemplo n.º 26
0
        public void Cancel()
        {
            try
            {
                onCancelCall?.Invoke();
            }
            catch (Exception e)
            {
                RxAdvancedFlowPlugins.OnError(e);
            }

            s.Cancel();
        }
        void Error(Exception e, int index)
        {
            if (ExceptionHelper.Add(ref error, e))
            {
                SvDone();

                Drain();
            }
            else
            {
                RxAdvancedFlowPlugins.OnError(e);
            }
        }
Exemplo n.º 28
0
        public void OnError(Exception e)
        {
            worker.Dispose();

            long idx = Interlocked.Increment(ref sharedIndex);

            if (idx != localIndex)
            {
                RxAdvancedFlowPlugins.OnError(e);
                return;
            }

            actual.OnError(e);
        }
        void InnerError(Exception e, PublisherConcatMapEagerInner inner)
        {
            if (ExceptionHelper.Add(ref error, e))
            {
                Volatile.Write(ref done, true);
                inner.SetDone();

                Drain();
            }
            else
            {
                RxAdvancedFlowPlugins.OnError(e);
            }
        }
Exemplo n.º 30
0
 /// <summary>
 /// Sets a subscription reference field or reports an error if already set.
 /// </summary>
 /// <param name="d"></param>
 /// <param name="v"></param>
 /// <returns></returns>
 public static bool SetSubscription(ref ISubscription d, ISubscription v)
 {
     if (v == null)
     {
         RxAdvancedFlowPlugins.OnError(new NullReferenceException("v"));
         return(false);
     }
     if (d != null)
     {
         ReportSubscriptionSet();
         return(false);
     }
     d = v;
     return(true);
 }