public IDisposable Run() { sourceSubscription = new SingleAssignmentDisposable(); timerSubscription = new SerialDisposable(); timerSubscription.Disposable = RunTimer(objectId); sourceSubscription.Disposable = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(timerSubscription, sourceSubscription)); }
public IDisposable Run() { sourceSubscription = new SingleAssignmentDisposable(); sourceSubscription.Disposable = parent.source.Subscribe(this); var scheduling = UnityObservable.IntervalFrame(parent.frameCount, parent.frameCountType) .Subscribe(new SampleFrameTick(this)); return(StableCompositeDisposable.Create(sourceSubscription, scheduling)); }
public IDisposable Run() { return(StableCompositeDisposable.Create(parent.source.Subscribe(this), Disposable.Create(() => { if (!isCompletedCall) { parent.onCancel(); } }))); }
public IDisposable Run() { list = new List <T>(); timerId = 0L; timerD = new SerialDisposable(); CreateTimer(); var subscription = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(subscription, timerD)); }
public IDisposable Run() { cancelationToken = new BooleanDisposable(); var _sourceSubscription = new SingleAssignmentDisposable(); sourceSubscription = _sourceSubscription; _sourceSubscription.Disposable = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(cancelationToken, sourceSubscription)); }
public IDisposable Run() { list = new List <T>(); var timerSubscription = Observable.Interval(parent.timeSpan, parent.scheduler) .Subscribe(new Buffer(this)); var sourceSubscription = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(timerSubscription, sourceSubscription)); }
public IDisposable Run() { var otherSubscription = new SingleAssignmentDisposable(); var otherObserver = new TakeUntilOther(this, otherSubscription); otherSubscription.Disposable = parent.other.Subscribe(otherObserver); var sourceSubscription = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(otherSubscription, sourceSubscription)); }
public IDisposable Run() { var l = parent.left.Subscribe(new LeftZipObserver(this)); var r = parent.right.Subscribe(new RightZipObserver(this)); return(StableCompositeDisposable.Create(l, r, Disposable.Create(() => { lock (gate) { leftQ.Clear(); rightQ.Clear(); } }))); }
public IDisposable Run() { totalTime = TimeSpan.Zero; nextShift = parent.timeShift; nextSpan = parent.timeSpan; q = new Queue <IList <T> >(); timerD = new SerialDisposable(); q.Enqueue(new List <T>()); CreateTimer(); var subscription = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(subscription, timerD)); }
public IDisposable Run() { isDisposed = false; e = parent.sources.GetEnumerator(); subscription = new SerialDisposable(); var schedule = Scheduler.DefaultSchedulers.TailRecursion.Schedule(RecursiveRun); return(StableCompositeDisposable.Create(schedule, subscription, Disposable.Create(() => { lock (gate) { this.isDisposed = true; this.e.Dispose(); } }))); }
static AsyncSubject <TSource> RunAsync <TSource>(IConnectableObservable <TSource> source, CancellationToken cancellationToken) { var s = new AsyncSubject <TSource>(); if (cancellationToken.IsCancellationRequested) { return(Cancel(s, cancellationToken)); } var d = source.Subscribe(s); var c = source.Connect(); if (cancellationToken.CanBeCanceled) { RegisterCancelation(s, StableCompositeDisposable.Create(d, c), cancellationToken); } return(s); }
public IDisposable Run() { sourceSubscription = new SingleAssignmentDisposable(); sourceSubscription.Disposable = parent.source.Subscribe(this); IDisposable scheduling; var periodicScheduler = parent.scheduler as ISchedulerPeriodic; if (periodicScheduler != null) { scheduling = periodicScheduler.SchedulePeriodic(parent.interval, OnNextTick); } else { scheduling = parent.scheduler.Schedule(parent.interval, OnNextRecursive); } return(StableCompositeDisposable.Create(sourceSubscription, scheduling)); }
public IDisposable Run() { IDisposable subscription; try { subscription = parent.source.Subscribe(this); } catch { // This behaviour is not same as .NET Official Rx parent.finallyAction(); throw; } return(StableCompositeDisposable.Create(subscription, Disposable.Create(() => { parent.finallyAction(); }))); }
public IDisposable Run() { isDisposed = false; var sourceDisposable = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(sourceDisposable, Disposable.Create(() => { lock (scheduleDisposables) { isDisposed = true; foreach (var item in scheduleDisposables) { item.Dispose(); } scheduleDisposables.Clear(); } }))); }
public IDisposable Run() { cancelable = new SerialDisposable(); active = false; running = false; queue = new Queue <Timestamped <T> >(); onCompleted = false; completeAt = default(DateTimeOffset); hasFailed = false; exception = default(Exception); ready = true; delay = Scheduler.Normalize(parent.dueTime); var _sourceSubscription = new SingleAssignmentDisposable(); sourceSubscription = _sourceSubscription; // assign to field _sourceSubscription.Disposable = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(sourceSubscription, cancelable)); }
public IDisposable Run() { leftSubscription = new SingleAssignmentDisposable(); rightSubscription = new SingleAssignmentDisposable(); var d = StableCompositeDisposable.Create(leftSubscription, rightSubscription); var left = new Amb(); left.targetDisposable = d; left.targetObserver = new AmbDecisionObserver(this, AmbState.Left, rightSubscription, left); var right = new Amb(); right.targetDisposable = d; right.targetObserver = new AmbDecisionObserver(this, AmbState.Right, leftSubscription, right); leftSubscription.Disposable = parent.source.Subscribe(left); rightSubscription.Disposable = parent.second.Subscribe(right); return(d); }
public IDisposable Run() { var subscription = parent.sources.Subscribe(this); return(StableCompositeDisposable.Create(subscription, innerSubscription)); }
public IDisposable Run() { var sourceDisposable = parent.source.Subscribe(this); return(StableCompositeDisposable.Create(sourceDisposable, isDisposed)); }