|
|
@ -23,11 +23,15 @@ public final class OpenGroupPollerV2 : NSObject {
|
|
|
|
guard let strongSelf = self else { return }
|
|
|
|
guard let strongSelf = self else { return }
|
|
|
|
strongSelf.hasStarted = true
|
|
|
|
strongSelf.hasStarted = true
|
|
|
|
strongSelf.timer = Timer.scheduledTimer(withTimeInterval: strongSelf.pollInterval, repeats: true) { _ in
|
|
|
|
strongSelf.timer = Timer.scheduledTimer(withTimeInterval: strongSelf.pollInterval, repeats: true) { _ in
|
|
|
|
|
|
|
|
DispatchQueue.global().async {
|
|
|
|
self?.poll().retainUntilComplete()
|
|
|
|
self?.poll().retainUntilComplete()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DispatchQueue.global().async {
|
|
|
|
strongSelf.poll().retainUntilComplete()
|
|
|
|
strongSelf.poll().retainUntilComplete()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@objc public func stop() {
|
|
|
|
@objc public func stop() {
|
|
|
|
timer?.invalidate()
|
|
|
|
timer?.invalidate()
|
|
|
|