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
  • Identifies one of the global concurrent dispatch queues with specified quality of service class.

    See more

    Declaration

    Swift

    public enum DispatchQueueSchedulerQOS
  • 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 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