- improve performance when changing the widget

- move trigger process.read when changing the number of top processes to the background
This commit is contained in:
Serhiy Mytrovtsiy
2020-10-29 16:46:22 +01:00
parent e1e7825b18
commit f8ba0b8bf7
5 changed files with 16 additions and 5 deletions

View File

@@ -91,7 +91,9 @@ public class Network: Module {
self.settingsView.callbackWhenUpdateNumberOfProcesses = {
self.popupView.numberOfProcessesUpdated()
self.processReader?.read()
DispatchQueue.global(qos: .background).async {
self.processReader?.read()
}
}
self.usageReader?.readyCallback = { [unowned self] in