Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong usage of ISchedulerLongRunning in ObserveOn #881

Merged
merged 1 commit into from Apr 10, 2019

Conversation

akarnokd
Copy link
Collaborator

The optimized ObserveOn was using the ISchedulerLongRunning scheduler incorrectly. This type of scheduler is meant to be kept alive by possibly blocking the backing thread as long as the sequence is still active.

Additional changes:

  • Removed the ISchedulerLongRunning cases from the ObserveOnObserverNew implementation.
  • The ObserveOnObserverNew no longer supports error delaying (Based on unit tests, it was expected only from ISchedulerLongRunning schedulers anyway).
  • Created a new ObserveOnObserverLongRunning dedicated to working with ISchedulerLongRunning.
  • The choice of which implementation to use has been moved to assembly time inside the ObserveOn extension method.
  • Added unit test to verify there is no thread hopping with the TaskPoolScheduler.
  • Added unit test to verify applying DisableOptimizations to TaskPoolScheduler and calling AsLongRunning() no longer returns an ISchedulerLongRunning implementation.

Fixes #877

@clairernovotny clairernovotny merged commit 1214c26 into dotnet:rel/v4.1 Apr 10, 2019
@akarnokd akarnokd deleted the ObserveOnLongRunningFix branch April 10, 2019 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants