Skip to content

Instantly share code, notes, and snippets.

@Otbivnoe
Last active September 13, 2017 10:05
Show Gist options
  • Select an option

  • Save Otbivnoe/3a49c44ec77f0a3ac6318ce65689ef2b to your computer and use it in GitHub Desktop.

Select an option

Save Otbivnoe/3a49c44ec77f0a3ac6318ce65689ef2b to your computer and use it in GitHub Desktop.
let queue = DispatchQueue.global()
let scheduler = ConcurrentDispatchQueueScheduler(queue: queue)
let observable = Observable<Void>.create { observer in
observer.onCompleted()
return ScheduledDisposable(scheduler: scheduler, disposable: Disposables.create {
print("thread - \(Thread.current)")
})
}
observable.subscribe()
// log:
// thread - <NSThread: 0x7f9631d62e60>{number = 3, name = (null)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment