Skip to content

VirtualTimeScheduler - fix typo #2671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions RxSwift/Schedulers/VirtualTimeScheduler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
- returns: The disposable object used to cancel the scheduled action (best effort).
*/
public func scheduleAbsoluteVirtual<StateType>(_ state: StateType, time: VirtualTime, action: @escaping (StateType) -> Disposable) -> Disposable {
ensusreRunningOnCorrectThread()
ensureRunningOnCorrectThread()
let compositeDisposable = CompositeDisposable()

let item = VirtualSchedulerItem(action: {
Expand All @@ -136,7 +136,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
return
}

ensusreRunningOnCorrectThread()
ensureRunningOnCorrectThread()
self.running = true
repeat {
guard let next = self.findNext() else {
Expand Down Expand Up @@ -175,7 +175,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
fatalError("Scheduler is already running")
}

ensusreRunningOnCorrectThread()
ensureRunningOnCorrectThread()
self.running = true
repeat {
guard let next = self.findNext() else {
Expand All @@ -199,7 +199,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>

/// Advances the scheduler's clock by the specified relative time.
public func sleep(_ virtualInterval: VirtualTimeInterval) {
ensusreRunningOnCorrectThread()
ensureRunningOnCorrectThread()
let sleepTo = self.converter.offsetVirtualTime(self.clock, offset: virtualInterval)
if self.converter.compareVirtualTime(sleepTo, self.clock).lessThen {
fatalError("Can't sleep to past.")
Expand All @@ -210,7 +210,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>

/// Stops the virtual time scheduler.
public func stop() {
ensusreRunningOnCorrectThread()
ensureRunningOnCorrectThread()
self.running = false
}

Expand All @@ -220,7 +220,7 @@ open class VirtualTimeScheduler<Converter: VirtualTimeConverterType>
}
#endif

private func ensusreRunningOnCorrectThread() {
private func ensureRunningOnCorrectThread() {
guard Thread.current == thread else {
rxFatalError("Executing on the wrong thread. Please ensure all work on the same thread.")
}
Expand Down