Exemple #1
0
            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));
            }
Exemple #2
0
        protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel)
        {
            var d = new MultipleAssignmentDisposable();

            d.Disposable = UnityObservable.TimerFrame(frameCount, frameCountType)
                           .SubscribeWithState3(observer, d, source, (_, o, disp, s) => { disp.Disposable = s.Subscribe(o); });

            return(d);
        }
        protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel)
        {
            var d = new MultipleAssignmentDisposable();

            d.Disposable = UnityObservable.TimerFrame(frameCount, frameCountType)
                           .Subscribe(_ =>
            {
                d.Disposable = source.Subscribe(observer);
            });

            return(d);
        }
Exemple #4
0
            public override void OnNext(T value)
            {
                ulong currentid;

                lock (gate) {
                    hasValue    = true;
                    latestValue = value;
                    id          = unchecked (id + 1);
                    currentid   = id;
                }

                var d = new SingleAssignmentDisposable();

                cancelable.Disposable = d;
                d.Disposable          = UnityObservable.TimerFrame(parent.frameCount, parent.frameCountType)
                                        .Subscribe(new ThrottleFrameTick(this, currentid));
            }
Exemple #5
0
            public override void OnNext(T value)
            {
                lock (gate) {
                    if (!open)
                    {
                        return;
                    }
                    observer.OnNext(value);
                    open = false;
                }

                var d = new SingleAssignmentDisposable();

                cancelable.Disposable = d;
                d.Disposable          = UnityObservable.TimerFrame(parent.frameCount, parent.frameCountType)
                                        .Subscribe(tick);
            }
Exemple #6
0
 IDisposable RunTimer(ulong timerId)
 {
     return(UnityObservable.TimerFrame(parent.frameCount, parent.frameCountType)
            .Subscribe(new TimeoutFrameTick(this, timerId)));
 }