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

Use Task.Run to start OperationQueue. #1

Merged
merged 1 commit into from May 16, 2018
Merged

Conversation

grokys
Copy link

@grokys grokys commented May 15, 2018

Port of reactiveui#407 targetting GHfVS branch.

@grokys grokys requested review from shana and jcansdale May 15, 2018 14:40
grokys added a commit to github/VisualStudio that referenced this pull request May 15, 2018
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 changed the title Use Task.Factory.StartNew to start OperationQueue. Use Task.Run to start OperationQueue. May 16, 2018
grokys added a commit to github/VisualStudio that referenced this pull request May 16, 2018
Copy link

@jcansdale jcansdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Hopefully it will keep Akavache off the Main thread! 🤞

@jcansdale jcansdale merged commit 6464d1f into GHfVS May 16, 2018
@jcansdale jcansdale deleted the fixes/1662-task-startnew branch May 16, 2018 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants