Replies: 1 comment 1 reply
-
Fixed by changing public typealias NPath = @Sendable () async throws -> AsyncStream< NetworkPath >
extension PathMonitorClient: DependencyKey {
static public var liveValue: Self = .init {
AsyncStream { continuation in
let monitor = NWPathMonitor() // will be any issue memory ?
monitor.pathUpdateHandler = { path in
continuation.yield(NetworkPath.init(rawValue: path))
}
continuation.onTermination = { _ in
monitor.cancel()
}
monitor.start(queue: DispatchQueue(label: "NSPathMonitor.paths"))
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to update old PathMonitorClient code to
async
having some issue
Old Code
Here is new Code
Going to add CommonTCALibraries so rest of community can get help Click 👇🏼
Going to add CommonTCALibraries so rest of community can get help
Beta Was this translation helpful? Give feedback.
All reactions