feat: added an option to show ICMP status and latency in the text widget (allows to show ping latency in the menu bar)

This commit is contained in:
Serhiy Mytrovtsiy
2025-03-14 21:17:23 +01:00
parent 24bca54fd3
commit 5effa6440a
3 changed files with 15 additions and 1 deletions

View File

@@ -41,7 +41,12 @@ open class Reader<T: Codable>: NSObject, ReaderInternal_p {
public var log: NextLog {
NextLog.shared.copy(category: "\(String(describing: self))")
}
public var value: T?
private let valueQueue = DispatchQueue(label: "eu.exelban.readerActiveQueue")
private var _value: T?
public var value: T? {
get { self.valueQueue.sync { self._value } }
set { self.valueQueue.sync { self._value = newValue } }
}
public var name: String {
String(NSStringFromClass(type(of: self)).split(separator: ".").last ?? "unknown")
}