I have the following method that uses implicit planning:
private async Task FooAsync()
{
await Something();
DoAnotherThing();
await SomethingElse();
DoOneLastThing();
}
However, from one specific call site, I want it to run in the low-priority scheduler instead of the standard one:
private async Task BarAsync()
{
await Task.Factory.StartNew(() => await FooAsync(),
...,
...,
LowPriorityTaskScheduler);
}
How do I achieve this? This seems like a really simple question, but I have a complete mental block!
Note: I know that the example will not actually compile :)
source
share