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 moreDeclaration
Swift
public class ConcurrentDispatchQueueScheduler : SchedulerType
-
Abstracts work that needs to be performed on
MainThread
. In caseschedule
methods are called from main thread, it will perform action immediately without scheduling.This scheduler is optimized for
See moresubscribeOn
operator. If you want to observe observable sequence elements on main thread usingobserveOn
operator,MainScheduler
is more suitable for that purpose.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
See moretrampoline scheduler
.Declaration
Swift
public class CurrentThreadScheduler : ImmediateSchedulerType
-
Provides a virtual time scheduler that uses
See moreDate
for absolute time andTimeInterval
for relative time.Declaration
Swift
public class HistoricalScheduler : VirtualTimeScheduler<HistoricalSchedulerTimeConverter>
-
Converts historical virtual time into real time.
Since historical virtual time is also measured in
See moreDate
, this converter is identity function.Declaration
Swift
public struct HistoricalSchedulerTimeConverter : VirtualTimeConverterType
-
Abstracts work that needs to be performed on
DispatchQueue.main
. In caseschedule
methods are called fromDispatchQueue.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
See moreobserveOn
operator. To ensure observable sequence is subscribed on main thread usingsubscribeOn
operator please useConcurrentMainScheduler
because it is more optimized for that purpose.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
See moremaxConcurrentOperationCount
.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
See moreserialQueueConfiguration
callback.Declaration
Swift
public class SerialDispatchQueueScheduler : SchedulerType
-
Parametrization for virtual time used by
See moreVirtualTimeScheduler
s.Declaration
Swift
public protocol VirtualTimeConverterType
-
Base class for virtual time schedulers using a priority queue for scheduled items.
See moreDeclaration
Swift
open class VirtualTimeScheduler<Converter: VirtualTimeConverterType> : SchedulerType
extension VirtualTimeScheduler: CustomDebugStringConvertible