This page on MSDN指出
我实际上希望有一个引用表,可观察到的运算符(operator)将使用该引用表使用默认的Scheduler,但在任何地方都找不到。 每个可观察到的运算符的默认调度程序是什么?
最佳答案
哇,这可不是一件容易的事...
在System.Reactive.Concurrency
命名空间的内部,存在一个内部静态类SchedulerDefaults
,它声明为:
internal static class SchedulerDefaults
{
internal static IScheduler AsyncConversions
{ get { return DefaultScheduler.Instance; }}
internal static IScheduler ConstantTimeOperations
{ get { return ImmediateScheduler.Instance; }}
internal static IScheduler Iteration
{ get { return CurrentThreadScheduler.Instance; }}
internal static IScheduler TailRecursion
{ get { return ImmediateScheduler.Instance; }}
internal static IScheduler TimeBasedOperations
{ get { return DefaultScheduler.Instance; }}
}
AsyncConversions
用于:Start, ToAsync, FromAsyncPattern
ConstantTimeOperations
用于:Empty, GetSchedulerForCurrentContext, Return, StartWith, Throw
Iteration
用于:Generate, Range, Repeat, TakeLast, ToObservable, and the ReplaySubject<T>
TailRecursion
用于:Run
TimeBasedOperations
用于:Buffer, Delay, DelaySubscription, Generate, Interval, Sample, Skip, SkipLast
SkipUntil, Take, TakeLast, TakeLastBuffer, TakeUntil, Throttle, TimeInterval,
Timeout, Timer, Timestamp, Window
关于c# - 每个可观察运算符的默认调度程序是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15341864/