1
0

TestTaskScheduler.cs 769 B

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