TestTaskScheduler.cs 753 B

123456789101112131415161718192021222324252627
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Collections.Generic;
  5. using System.Threading.Tasks;
  6. namespace ReactiveTests
  7. {
  8. internal class TestTaskScheduler : TaskScheduler
  9. {
  10. protected override void QueueTask(Task task)
  11. {
  12. TryExecuteTaskInline(task, false);
  13. }
  14. protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
  15. {
  16. return TryExecuteTask(task);
  17. }
  18. protected override IEnumerable<Task> GetScheduledTasks()
  19. {
  20. return null;
  21. }
  22. }
  23. }