Skip to content

Instantly share code, notes, and snippets.

@eunjin3786
Last active June 28, 2019 05:49
Show Gist options
  • Save eunjin3786/47ef9b31d276573c6a81eb02107a782a to your computer and use it in GitHub Desktop.
Save eunjin3786/47ef9b31d276573c6a81eb02107a782a to your computer and use it in GitHub Desktop.
let backgroundScheduler = SerialDispatchQueueScheduler(qos: .background)
Observable.just(1)
.map { _ in
print(Thread.isMainThread) // false
}
.subscribeOn(backgroundScheduler)
.map { _ in
print(Thread.isMainThread) // false
}
.subscribe(onNext: {
print(Thread.isMainThread) // false
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment