Refactor Polling Mechanism: Implement Class-Based Poller with Start/Stop Control (#528)

* custom module updates to class based.

* Finish poller logic.

* Use composition for pollers

* Rename poller

* Handle recorder polling.

* Fix quotes in bash command

* Remove logs
This commit is contained in:
Jas Singh
2024-11-23 03:55:00 -08:00
committed by GitHub
parent c10c9d0e93
commit a4f5fb5917
26 changed files with 460 additions and 169 deletions

View File

@@ -2,7 +2,7 @@
const GLib = imports.gi.GLib;
import { pollVariable } from 'customModules/PollVar';
import { FunctionPoller } from 'lib/poller/FunctionPoller';
import { GenericResourceData } from 'lib/types/customModules/generic';
class Ram {
@@ -13,7 +13,14 @@ class Ram {
constructor() {
this.calculateUsage = this.calculateUsage.bind(this);
pollVariable(this.ram, [], this.updateFrequency.bind('value'), this.calculateUsage);
const ramPoller = new FunctionPoller<GenericResourceData, []>(
this.ram,
[],
this.updateFrequency.bind('value'),
this.calculateUsage,
);
ramPoller.start();
}
public calculateUsage(): GenericResourceData {