Skip to content

Conversation

@grokys
Copy link
Member

@grokys grokys commented May 15, 2018

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix

What is the current behavior? (You can also link to an open issue here)

See #406

What is the new behavior (if this is a feature change)?

Use Task.Run to start OperationQueue's processing task rather than using the constructor and then calling task.Start. This ensures two things:

  1. The TaskScheduler.Default scheduler is used, which will be a threadpool scheduler
  2. That task tracks the running of the entire task: previously the task will have completed when it awaited as the Task constructor accepts an Action and not a Func<Task>

Note that TaskCreationOptions.LongRunning is no longer being passed in, but according to https://blog.stephencleary.com/2013/08/startnew-is-dangerous.html that parameter is just an "optimization hint" and the the threadpool should adjust to the long-running task automatically.

Does this PR introduce a breaking change?

No

Please check if the PR fulfills these requirements

I'm not quite sure what a test/docs would look like for this?

Use `Task.Run` to start `OperationQueue`'s processing task rather than using
the constructor and then calling `task.Start`. This ensures two things:

1. The `TaskScheduler.Default` scheduler is used, which will be a threadpool
scheduler
2. That `task` tracks the running of the entire task: previously the task
will have completed when it `await`ed as the `Task` constructor accepts an
`Action` and not a `Func<Task>`

Fixes reactiveui#406
@grokys grokys force-pushed the fixes/406-operationqueue-scheduler branch from c4184e8 to 8727243 Compare May 15, 2018 16:47
@anaisbetts
Copy link
Member

Ugh, it seems like AppVeyor wandered off :-/ Paging @onovotny @ghuntley

@PureWeen
Copy link
Collaborator

On another note appveyor was broken a few months ago which this PR
#384

took care of with forcing the version of Cake

grokys added a commit to github/VisualStudio that referenced this pull request May 16, 2018
@PureWeen PureWeen merged commit bb2e400 into reactiveui:develop May 21, 2018
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants