MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / constructor

Method constructor

static/js/utils.js:435–445  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

433
434class AdaptivePoller {
435 constructor(options = {}) {
436 const base = Number(options.baseIntervalMs ?? options.baseMs ?? 1200);
437 const max = Number(options.maxIntervalMs ?? options.maxMs ?? 12000);
438 this.baseIntervalMs = Math.max(300, Number.isFinite(base) ? base : 1200);
439 this.maxIntervalMs = Math.max(this.baseIntervalMs, Number.isFinite(max) ? max : 12000);
440 this.minIntervalMs = Math.max(250, Math.min(this.baseIntervalMs, Number(options.minIntervalMs || this.baseIntervalMs)));
441 this.jitterRatio = Math.min(0.2, Math.max(0, Number(options.jitterRatio || 0.08)));
442 this.failureCount = 0;
443 this.successCount = 0;
444 this.lastDelayMs = this.baseIntervalMs;
445 }
446
447 getConnectionMultiplier() {
448 const connection = navigator?.connection || navigator?.mozConnection || navigator?.webkitConnection;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected