ConcurrentMainScheduler
public final class ConcurrentMainScheduler : 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.
-
Undocumented
Declaration
Swift
public typealias TimeInterval = Foundation.TimeInterval -
Undocumented
Declaration
Swift
public typealias Time = Date -
Declaration
Swift
public var now: Date { get }Return Value
Current time.
-
Singleton instance of
ConcurrentMainSchedulerDeclaration
Swift
public static let instance: ConcurrentMainScheduler -
Schedules an action to be executed immediately.
Declaration
Swift
public func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> DisposableParameters
stateState passed to the action to be executed.
actionAction to be executed.
Return Value
The disposable object used to cancel the scheduled action (best effort).
-
Schedules an action to be executed.
Declaration
Swift
public final func scheduleRelative<StateType>(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> DisposableParameters
stateState passed to the action to be executed.
dueTimeRelative time after which to execute the action.
actionAction to be executed.
Return Value
The disposable object used to cancel the scheduled action (best effort).
-
Schedules a periodic piece of work.
Declaration
Swift
public func schedulePeriodic<StateType>(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> DisposableParameters
stateState passed to the action to be executed.
startAfterPeriod after which initial work should be run.
periodPeriod for running the work periodically.
actionAction to be executed.
Return Value
The disposable object used to cancel the scheduled action (best effort).
View on GitHub
ConcurrentMainScheduler Class Reference