//#region src/cognitive/scheduler/event-sources/info-scan-source.ts
var InfoScanSource = class {
	constructor(intervalMs) {
		this.intervalMs = intervalMs;
		this.listeners = [];
	}
	onEvent(listener) {
		this.listeners.push(listener);
	}
	start() {
		this.handle = setInterval(() => {
			const event = {
				type: "info_scan",
				timestamp: Date.now(),
				payload: { scanIntervalMs: this.intervalMs }
			};
			for (const listener of this.listeners) listener(event);
		}, this.intervalMs);
		if (this.handle.unref) this.handle.unref();
	}
	stop() {
		if (this.handle !== void 0) {
			clearInterval(this.handle);
			this.handle = void 0;
		}
	}
};
//#endregion
export { InfoScanSource };
