network: debounce nmcli monitor events
Batch rapid nmcli monitor events with a 200ms debounce timer instead of spawning processes on every event line.
This commit is contained in:
parent
30c36e356d
commit
11f5a2ee45
1 changed files with 13 additions and 6 deletions
|
|
@ -309,16 +309,23 @@ Singleton {
|
|||
return octets.join(".");
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: monitorDebounce
|
||||
|
||||
interval: 200
|
||||
onTriggered: {
|
||||
Nmcli.getNetworks(() => {
|
||||
syncNetworksFromNmcli();
|
||||
});
|
||||
getEthernetDevices();
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
running: true
|
||||
command: ["nmcli", "m"]
|
||||
stdout: SplitParser {
|
||||
onRead: {
|
||||
Nmcli.getNetworks(() => {
|
||||
syncNetworksFromNmcli();
|
||||
});
|
||||
getEthernetDevices();
|
||||
}
|
||||
onRead: monitorDebounce.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue