RxSwift/Schedulers

  • Abstracts the work that needs to be performed on a specific dispatch_queue_t. You can also pass a serial dispatch queue, it shouldn’t cause any problems.

    This scheduler is suitable when some work needs to be performed in background.

    See more

    Declaration

    Swift

    public class ConcurrentDispatchQueueScheduler : SchedulerType
  • Abstracts work that needs to be performed on MainThread. In case schedule methods are called from main thread, it will perform action immediately without scheduling.

    This scheduler is optimized for subscribeOn operator. If you want to observe observable sequence elements on main thread using observeOn operator, MainScheduler is more suitable for that purpose.

    See more

    Declaration

    Swift

    public final class ConcurrentMainScheduler : SchedulerType
  • Represents an object that schedules units of work on the current thread.

    This is the default scheduler for operators that generate elements.

    This scheduler is also sometimes called trampoline scheduler.

    See more

    Declaration

    Swift

    public class CurrentThreadScheduler : ImmediateSchedulerType
  • Provides a virtual time scheduler that uses Date for absolute time and TimeInterval for relative time.

    See more

    Declaration

    Swift

    public class HistoricalScheduler : VirtualTimeScheduler<HistoricalSchedulerTimeConverter>
  • Converts historical virtual time into real time.

    Since historical virtual time is also measured in Date, this converter is identity function.

    See more

    Declaration

    Swift

    public struct HistoricalSchedulerTimeConverter : VirtualTimeConverterType
  • Abstracts work that needs to be performed on DispatchQueue.main. In case schedule methods are called from DispatchQueue.main, it will perform action immediately without scheduling.

    This scheduler is usually used to perform UI work.

    Main scheduler is a specialization of SerialDispatchQueueScheduler.

    This scheduler is optimized for observeOn operator. To ensure observable sequence is subscribed on main thread using subscribeOn operator please use ConcurrentMainScheduler because it is more optimized for that purpose.

    See more

    Declaration

    Swift

    public final class MainScheduler : SerialDispatchQueueScheduler
  • Abstracts the work that needs to be performed on a specific NSOperationQueue.

    This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using maxConcurrentOperationCount.

    See more

    Declaration

    Swift

    public class OperationQueueScheduler : ImmediateSchedulerType
  • Abstracts the work that needs to be performed on a specific dispatch_queue_t. It will make sure that even if concurrent dispatch queue is passed, it’s transformed into a serial one.

    It is extremely important that this scheduler is serial, because certain operator perform optimizations that rely on that property.

    Because there is no way of detecting is passed dispatch queue serial or concurrent, for every queue that is being passed, worst case (concurrent) will be assumed, and internal serial proxy dispatch queue will be created.

    This scheduler can also be used with internal serial queue alone.

    In case some customization need to be made on it before usage, internal serial queue can be customized using serialQueueConfiguration callback.

    See more

    Declaration

    Swift

    public class SerialDispatchQueueScheduler : SchedulerType
  • Parametrization for virtual time used by VirtualTimeSchedulers.

    See more

    Declaration

    Swift

    public protocol VirtualTimeConverterType
  • Base class for virtual time schedulers using a priority queue for scheduled items.

    See more

    Declaration

    Swift

    open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
        : SchedulerType
    extension VirtualTimeScheduler: CustomDebugStringConvertible