コード例 #1
0
ファイル: Amb.cs プロジェクト: WindowsCE/System.Reactive
            public IDisposable Run(Amb <TSource> parent)
            {
                var ls = new SingleAssignmentDisposable();
                var rs = new SingleAssignmentDisposable();
                var d  = StableCompositeDisposable.Create(ls, rs);

                var gate = new object();

                var lo = new AmbObserver();

                lo._disposable = d;
                lo._target     = new DecisionObserver(this, gate, AmbState.Left, ls, rs, lo);

                var ro = new AmbObserver();

                ro._disposable = d;
                ro._target     = new DecisionObserver(this, gate, AmbState.Right, rs, ls, ro);

                _choice = AmbState.Neither;

                ls.Disposable = parent._left.SubscribeSafe(lo);
                rs.Disposable = parent._right.SubscribeSafe(ro);

                return(d);
            }
コード例 #2
0
ファイル: Amb.cs プロジェクト: csoren/RxBridge
 public _(Amb <TSource> parent, IObserver <TSource> observer, IDisposable cancel)
     : base(observer, cancel)
 {
     _parent = parent;
 }