INNER CODE UNIT · TypeScript
probeLoop
gommzystudio/device-activity-tracker · src/signal-tracker.ts:225
private async probeLoop() {
while (this.isTracking) {
try {
// Serialized probing: wait for previous probe to complete before sending next
await this.sendSerializedProbe();
} catch (err) {
logger.debug('Error sending probe:', err);
}
// Small delay between probes
const delay = Math.floor(Math.random() * 1000) + 1000;
await new Promise(resolve => setTimeout(resolve, delay));
}
}
/**
* Send a probe and wait for receipt or timeout before returning
* This ensures only ONE probe is in flight at a time (serialization)
*/