Rx for .NET - Scheduler.Dispatcher发生了什么? [英] Rx for .NET - What happened to Scheduler.Dispatcher?
问题描述
大部分变化是微不足道的(更改从三个dll到一个dll,改变命名空间使用等),但我正在努力地了解我应该在Dan的示例中使用什么代替Scheduler.Dispatcher。我不能在调度程序中可用的属性中看到任何明显的东西。
这是我试图使用(重构的)Rx库的代码(currenly stable version v1.0.10605)
var query = from Enumerable.Range(1,25)select StringWait number.ToString());
var observableQuery = query.ToObservable(Scheduler.ThreadPool);
observableQuery.ObserveOn(Scheduler **。Dispatcher **)。订阅(n => Results.AppendText(string.Format({0} \\\
,n)));
我应该用什么来调用原始Dispatcher线程上的Observer代码(Results.AppendText)?
DispatcherScheduler
已移至 System.Reactive.Windows.Threading
程序集。如果您使用的是NuGet,则它位于 Rx-WPF
I'm trying to work through Dan Sullivan's Rx Extensions training course on PluralSight. It's excellent stuff but unfortunately Rx seems to have already been changed, even though the course was only published a month ago.
Most of the changes are trivial to work out (change from three dlls to a single dll, change in namespaces used etc) but I'm struggling to understand what I should use in place of Scheduler.Dispatcher in Dan's example. I can't see anything obvious in the properties that are available in the Scheduler.
Here's the code I'm trying to get working with the (refactored?) Rx library (the currenly stable version v1.0.10605)
var query = from number in Enumerable.Range(1, 25) select StringWait(number.ToString());
var observableQuery = query.ToObservable(Scheduler.ThreadPool);
observableQuery.ObserveOn(Scheduler**.Dispatcher**).Subscribe(n => Results.AppendText(string.Format("{0}\n", n)));
What should I be using to invoke the Observer code (Results.AppendText) on the original Dispatcher thread?
The DispatcherScheduler
has been moved to the System.Reactive.Windows.Threading
assembly. If you are using NuGet, it's in Rx-WPF
这篇关于Rx for .NET - Scheduler.Dispatcher发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!