docs/Classes/ConcurrentMainScheduler.html
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.
`
TimeInterval
`
Undocumented
Swift
public typealias TimeInterval = Foundation.TimeInterval
`
Time
`
Undocumented
Swift
public typealias Time = Date
`
now
`
Swift
public var now: Date { get }
Current time.
`
instance
`
Singleton instance of ConcurrentMainScheduler
Swift
public static let instance: ConcurrentMainScheduler
`
schedule(_:action:)
`
Schedules an action to be executed immediately.
Swift
public func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable
| state |
State passed to the action to be executed.
|
| action |
Action to be executed.
|
The disposable object used to cancel the scheduled action (best effort).
`
scheduleRelative(_:dueTime:action:)
`
Schedules an action to be executed.
Swift
public final func scheduleRelative<StateType>(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable
| state |
State passed to the action to be executed.
|
| dueTime |
Relative time after which to execute the action.
|
| action |
Action to be executed.
|
The disposable object used to cancel the scheduled action (best effort).
`
schedulePeriodic(_:startAfter:period:action:)
`
Schedules a periodic piece of work.
Swift
public func schedulePeriodic<StateType>(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable
| state |
State passed to the action to be executed.
|
| startAfter |
Period after which initial work should be run.
|
| period |
Period for running the work periodically.
|
| action |
Action to be executed.
|
The disposable object used to cancel the scheduled action (best effort).