Exemplo n.º 1
0
            public IDisposable SchedulePeriodic(TimeSpan period, Action action)
            {
                var d    = new BooleanDisposable();
                var time = Scheduler.Normalize(period);

                MainThreadDispatcher.SendStartCoroutine(PeriodicAction(time, action, d));

                return(d);
            }
Exemplo n.º 2
0
            public IDisposable Schedule(TimeSpan dueTime, Action action)
            {
                var d    = new BooleanDisposable();
                var time = Scheduler.Normalize(dueTime);

                MainThreadDispatcher.SendStartCoroutine(DelayAction(time, action, d));

                return(d);
            }
Exemplo n.º 3
0
        public static UtyRx.IObservable <T> FromCoroutine <T>(Func <UtyRx.IObserver <T>, CancellationToken, IEnumerator> coroutine)
        {
            return(Observable.Create <T>(observer =>
            {
                var cancel = new BooleanDisposable();

                MainThreadDispatcher.SendStartCoroutine(coroutine(observer, new CancellationToken(cancel)));

                return cancel;
            }));
        }