TestTaskScheduler.cs 691 B

123456789101112131415161718192021222324252627
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. #if !NO_TPL
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. namespace ReactiveTests
  6. {
  7. class TestTaskScheduler : TaskScheduler
  8. {
  9. protected override void QueueTask(Task task)
  10. {
  11. TryExecuteTaskInline(task, false);
  12. }
  13. protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
  14. {
  15. return TryExecuteTask(task);
  16. }
  17. protected override IEnumerable<Task> GetScheduledTasks()
  18. {
  19. return null;
  20. }
  21. }
  22. }
  23. #endif