Exemplo n.º 1
0
 public AmbDecisionObserver(AmbObservable <T> .AmbOuterObserver parent, AmbObservable <T> .AmbOuterObserver.AmbState me, IDisposable otherSubscription, AmbObservable <T> .AmbOuterObserver.Amb self)
 {
     this.parent            = parent;
     this.me                = me;
     this.otherSubscription = otherSubscription;
     this.self              = self;
 }
Exemplo n.º 2
0
            public IDisposable Run()
            {
                this.leftSubscription  = new SingleAssignmentDisposable();
                this.rightSubscription = new SingleAssignmentDisposable();
                ICancelable cancelable = StableCompositeDisposable.Create(this.leftSubscription, this.rightSubscription);

                AmbObservable <T> .AmbOuterObserver.Amb amb = new AmbObservable <T> .AmbOuterObserver.Amb();

                amb.targetDisposable = cancelable;
                amb.targetObserver   = new AmbObservable <T> .AmbOuterObserver.AmbDecisionObserver(this, AmbObservable <T> .AmbOuterObserver.AmbState.Left, this.rightSubscription, amb);

                AmbObservable <T> .AmbOuterObserver.Amb amb2 = new AmbObservable <T> .AmbOuterObserver.Amb();

                amb2.targetDisposable = cancelable;
                amb2.targetObserver   = new AmbObservable <T> .AmbOuterObserver.AmbDecisionObserver(this, AmbObservable <T> .AmbOuterObserver.AmbState.Right, this.leftSubscription, amb2);

                this.leftSubscription.Disposable  = this.parent.source.Subscribe(amb);
                this.rightSubscription.Disposable = this.parent.second.Subscribe(amb2);
                return(cancelable);
            }
Exemplo n.º 3
0
 public AmbOuterObserver(AmbObservable <T> parent, IObserver <T> observer, IDisposable cancel)
     : base(observer, cancel)
 {
     this.parent = parent;
 }