This commit is contained in:
anlicheng 2025-08-03 01:04:53 +08:00
parent 5756422ebb
commit bedf7a01fc

View File

@ -98,13 +98,16 @@ actor SDLSuperClient {
} }
// --MARK: // --MARK:
// group.addTask { group.addTask {
// while !Task.isCancelled { while true {
// await self.ping() try Task.checkCancellation()
// try await Task.sleep(nanoseconds: 5 * 1_000_000_000) await self.ping()
// } try Task.checkCancellation()
// NSLog("[SDLSuperClient] heartbeat cancelled") try await Task.sleep(nanoseconds: 5 * 1_000_000_000)
// } try Task.checkCancellation()
}
NSLog("[SDLSuperClient] heartbeat cancelled")
}
try await group.waitForAll() try await group.waitForAll()
NSLog("[SDLSuperClient] group closed") NSLog("[SDLSuperClient] group closed")