docs/Classes/CurrentThreadScheduler.html
public class CurrentThreadScheduler : ImmediateSchedulerType
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.
`
instance
`
The singleton instance of the current thread scheduler.
Swift
public static let instance: CurrentThreadScheduler
`
isScheduleRequired
`
Gets a value that indicates whether the caller must call a schedule method.
Swift
public private(set) static var isScheduleRequired: Bool { get set }
`
schedule(_:action:)
`
Schedules an action to be executed as soon as possible on current thread.
If this method is called on some thread that doesn’t have CurrentThreadScheduler installed, scheduler will be automatically installed and uninstalled after all work is performed.
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).