Replace DispatchSource.schedule() with available methods

This commit is contained in:
Suyeol Jeon 2017-07-16 21:45:14 +09:00 committed by Krunoslav Zaher
parent 01febe3d22
commit 986fa8f3f6

View File

@ -43,7 +43,7 @@ extension DispatchQueueConfiguration {
let compositeDisposable = CompositeDisposable()
let timer = DispatchSource.makeTimerSource(queue: queue)
timer.schedule(deadline: deadline, leeway: leeway)
timer.scheduleOneshot(deadline: deadline, leeway: leeway)
// TODO:
// This looks horrible, and yes, it is.
@ -77,7 +77,7 @@ extension DispatchQueueConfiguration {
var timerState = state
let timer = DispatchSource.makeTimerSource(queue: queue)
timer.schedule(deadline: initial, repeating: dispatchInterval(period), leeway: leeway)
timer.scheduleRepeating(deadline: initial, interval: dispatchInterval(period), leeway: leeway)
// TODO:
// This looks horrible, and yes, it is.