protected override IDisposable SubscribeCore(UniRx.IObserver <T> observer, IDisposable cancel) { FromCoroutine arg = new FromCoroutine(observer, cancel); BooleanDisposable booleanDisposable = new BooleanDisposable(); CancellationToken arg2 = new CancellationToken(booleanDisposable); MainThreadDispatcher.SendStartCoroutine(coroutine(arg, arg2)); return(booleanDisposable); }
protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel) { var fromCoroutineObserver = new FromCoroutine(observer, cancel); var moreCancel = new BooleanDisposable(); MainThreadDispatcher.SendStartCoroutine(coroutine(fromCoroutineObserver, new CancellationToken(moreCancel))); return(moreCancel); }
protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel) { var fromCoroutineObserver = new FromCoroutine(observer, cancel); #if (NETFX_CORE || NET_4_6 || NET_STANDARD_2_0 || UNITY_WSA_10_0) var moreCancel = new CancellationDisposable(); var token = moreCancel.Token; #else var moreCancel = new BooleanDisposable(); var token = new CancellationToken(moreCancel); #endif MainThreadDispatcher.SendStartCoroutine(coroutine(fromCoroutineObserver, token)); return(moreCancel); }
protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel) { var fromCoroutineObserver = new FromCoroutine(observer, cancel); #if SystemReactive var cts = new CancellationTokenSource(); var cancelable = Disposable.Create(() => cts.Cancel()); MainThreadDispatcher.SendStartCoroutine(coroutine(fromCoroutineObserver, cts.Token)); return(cancelable); #else var moreCancel = new BooleanDisposable(); MainThreadDispatcher.SendStartCoroutine(coroutine(fromCoroutineObserver, new CancellationToken(moreCancel))); return(moreCancel); #endif }
protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel) { var fromCoroutineObserver = new FromCoroutine(observer, cancel); #if (ENABLE_MONO_BLEEDING_EDGE_EDITOR || ENABLE_MONO_BLEEDING_EDGE_STANDALONE) var moreCancel = new CancellationDisposable(); var token = moreCancel.Token; #else var moreCancel = new BooleanDisposable(); var token = new CancellationToken(moreCancel); #endif MainThreadDispatcher.SendStartCoroutine(coroutine(fromCoroutineObserver, token)); return(moreCancel); }
protected override IDisposable SubscribeCore(IObserver <T> observer, IDisposable cancel) { FromCoroutine fromCoroutineObserver = new FromCoroutine(observer, cancel); #if (NET_4_6) CancellationDisposable moreCancel = new CancellationDisposable(); CancellationToken token = moreCancel.Token; #else var moreCancel = new BooleanDisposable(); var token = new CancellationToken(moreCancel); #endif MainThreadDispatcher.SendStartCoroutine(coroutine(fromCoroutineObserver, token)); return(moreCancel); }