Browse Source

Task.Delay exists on all platforms now.

Bart De Smet 8 years ago
parent
commit
2b407d3dbe

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/TaskHelpers.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_TPL && !NO_TASK_DELAY
+#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
 

+ 0 - 22
Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs

@@ -107,7 +107,6 @@ namespace System.Reactive.Concurrency
             if (dt.Ticks == 0)
                 return Schedule(state, action);
 
-#if !NO_TASK_DELAY
             var d = new MultipleAssignmentDisposable();
 
             var ct = new CancellationDisposable();
@@ -120,9 +119,6 @@ namespace System.Reactive.Concurrency
             }, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnRanToCompletion, taskFactory.Scheduler);
 
             return d;
-#else
-            return DefaultScheduler.Instance.Schedule(state, dt, (_, state1) => Schedule(state1, action));
-#endif
         }
 
         /// <summary>
@@ -181,7 +177,6 @@ namespace System.Reactive.Concurrency
             if (action == null)
                 throw new ArgumentNullException(nameof(action));
 
-#if !NO_TASK_DELAY
             var cancel = new CancellationDisposable();
 
             var state1 = state;
@@ -207,23 +202,6 @@ namespace System.Reactive.Concurrency
             moveNext();
 
             return StableCompositeDisposable.Create(cancel, gate);
-#else
-            var state1 = state;
-            var gate = new AsyncLock();
-
-            var timer = ConcurrencyAbstractionLayer.Current.StartPeriodicTimer(() =>
-            {
-                taskFactory.StartNew(() =>
-                {
-                    gate.Wait(() =>
-                    {
-                        state1 = action(state1);
-                    });
-                });
-            }, period);
-
-            return StableCompositeDisposable.Create(timer, gate);
-#endif
         }
     }
 }

+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/Stress/Linq/ReplaySubject.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if STRESS && !NO_TPL && !NO_TASK_DELAY
+#if STRESS && !NO_TPL
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;