What are the default Schedulers for each observable operator?

Wow, that was not trivial to find…

Deep within the bowels of the System.Reactive.Concurrency namespace, there is an internal static class called SchedulerDefaults, which is declared as:

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 is used by:

Start, ToAsync, FromAsyncPattern

ConstantTimeOperations is used by:

Empty, GetSchedulerForCurrentContext, Return, StartWith, Throw

Iteration is used by:

Generate, Range, Repeat, TakeLast, ToObservable, and the ReplaySubject<T>

TailRecursion is used by:

Run

TimeBasedOperations is used by:

Buffer, Delay, DelaySubscription, Generate, Interval, Sample, Skip, SkipLast
SkipUntil, Take, TakeLast, TakeLastBuffer, TakeUntil, Throttle, TimeInterval,
Timeout, Timer, Timestamp, Window

Leave a Comment