MCPcopy Create free account
hub / github.com/deepclause/agentvm / waitForIO

Method waitForIO

src/ringbuffer.js:436–449  ·  view source on GitHub ↗

* Wait for any I/O (stdin or network) * @param {number} timeout - Timeout in ms (-1 for infinite) * @returns {boolean} - True if I/O is available

(timeout)

Source from the content-addressed store, hash-verified

434 * @returns {boolean} - True if I/O is available
435 */
436 waitForIO(timeout) {
437 const lastSignal = Atomics.load(this.int32, IO_READY_INDEX);
438
439 // Check if already ready
440 if (this.hasStdinData() || this.hasNetworkData()) {
441 return true;
442 }
443
444 // Wait for signal
445 const t = timeout < 0 ? undefined : timeout;
446 const result = Atomics.wait(this.int32, IO_READY_INDEX, lastSignal, t);
447
448 return result !== 'timed-out';
449 }
450
451 /**
452 * Get current IO signal value (for external wait coordination)

Callers 1

startFunction · 0.80

Calls 2

hasStdinDataMethod · 0.95
hasNetworkDataMethod · 0.95

Tested by

no test coverage detected