Initial commit

This commit is contained in:
2025-11-09 10:23:23 +01:00
commit f890341ffe
34 changed files with 1058 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import EventEmitter from "events";
import {Logger} from "../logging/logger.js";
export class BasePoller extends EventEmitter {
constructor() {
super();
this.task = null;
}
async pollOnce(){
throw new Error("Not implemented.");
}
start(interval) {
if(this.task){
Logger.error("A task has already been scheduled");
return;
}
super.task = setInterval(async () => {
await this.pollOnce();
}, interval);
}
stop() {
if (this.task) {
clearInterval(this.task);
super.task = null;
}
}
}