Open GerjanOnline opened 6 years ago
deprecate BackgroundWorker completely and come with an (better) alternative. For example one with async/await, cancellationtoken support etc. Would that be
Task.Factory.StartNew
orTask.Run
?
According to Stephen Cleary, yes, Task.Run
is the replacement for BackgroundWorker
, see his series of blog posts where he compares the two.
Assuming the team agrees with that, I think it would make sense to make BackgroundWorker
deprecated by adding it to the Platform Compatibility Analyzer.
Is [Deprecated] still used for a build-time notification, for those who may bypass the analyzer?
For me, it is very misleading that
BackgroundWorker.RunWorkerAsync
uses the convention with suffix *Async but doesn't return a Task.Please consider deprecating this method and come with a new methodname. The same applies to
CancelAsync
Fixing it would not be possible because it's a breaking change.
Or... deprecate BackgroundWorker completely and come with an (better) alternative. For example one with async/await, cancellationtoken support etc. Would that be
Task.Factory.StartNew
orTask.Run
?