test context
This commit is contained in:
parent
075010703a
commit
f410433aac
@ -108,6 +108,10 @@ public class SDLContext: @unchecked Sendable {
|
|||||||
self.rootTask = Task {
|
self.rootTask = Task {
|
||||||
try await withThrowingTaskGroup(of: Void.self) { group in
|
try await withThrowingTaskGroup(of: Void.self) { group in
|
||||||
group.addTask {
|
group.addTask {
|
||||||
|
defer {
|
||||||
|
self.logger.log("[SDLContext] UDPHole exit", level: .debug)
|
||||||
|
}
|
||||||
|
|
||||||
while !Task.isCancelled {
|
while !Task.isCancelled {
|
||||||
do {
|
do {
|
||||||
try await self.startUDPHole()
|
try await self.startUDPHole()
|
||||||
@ -119,6 +123,10 @@ public class SDLContext: @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group.addTask {
|
group.addTask {
|
||||||
|
defer {
|
||||||
|
self.logger.log("[SDLContext] SuperClient exit", level: .debug)
|
||||||
|
}
|
||||||
|
|
||||||
while !Task.isCancelled {
|
while !Task.isCancelled {
|
||||||
do {
|
do {
|
||||||
try await self.startSuperClient()
|
try await self.startSuperClient()
|
||||||
@ -135,6 +143,10 @@ public class SDLContext: @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group.addTask {
|
group.addTask {
|
||||||
|
defer {
|
||||||
|
self.logger.log("[SDLContext] noticeClient exit", level: .debug)
|
||||||
|
}
|
||||||
|
|
||||||
while !Task.isCancelled {
|
while !Task.isCancelled {
|
||||||
do {
|
do {
|
||||||
try await self.startNoticeClient()
|
try await self.startNoticeClient()
|
||||||
@ -149,6 +161,11 @@ public class SDLContext: @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Task {
|
||||||
|
try await Task.sleep(for: .seconds(20))
|
||||||
|
self.rootTask?.cancel()
|
||||||
|
}
|
||||||
|
|
||||||
try await self.rootTask?.value
|
try await self.rootTask?.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user