Skip to content

Commit

Permalink
remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Oct 30, 2024
1 parent e6f20b2 commit f6e9d7f
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions Sources/Realtime/V2/RealtimeClientV2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import ConcurrencyExtras
import Foundation
import Helpers
import Network

#if canImport(FoundationNetworking)
import FoundationNetworking
Expand Down Expand Up @@ -493,29 +492,3 @@ public final class RealtimeClientV2: Sendable {
url.appendingPathComponent("api/broadcast")
}
}

final class NetworkMonitor: @unchecked Sendable {
static let shared = NetworkMonitor()

private let monitor: NWPathMonitor
private let queue = DispatchQueue(label: "NetworkMonitor")

private(set) var isConnected: Bool = false

private init() {
monitor = NWPathMonitor()
}

func start(_ onChange: (@Sendable () -> Void)? = nil) {
monitor.pathUpdateHandler = { [weak self] path in
self?.isConnected = path.status != .unsatisfied
onChange?()
}

monitor.start(queue: queue)
}

func stop() {
monitor.cancel()
}
}

0 comments on commit f6e9d7f

Please sign in to comment.