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

Method readStdin

src/ringbuffer.js:317–331  ·  view source on GitHub ↗

* Read stdin data (returns null if none available)

()

Source from the content-addressed store, hash-verified

315 * Read stdin data (returns null if none available)
316 */
317 readStdin() {
318 if (Atomics.load(this.int32, STDIN_FLAG_INDEX) === 0) {
319 return null;
320 }
321
322 const size = Atomics.load(this.int32, STDIN_SIZE_INDEX);
323 const data = this.uint8.slice(STDIN_OFFSET, STDIN_OFFSET + size);
324
325 // Clear flag and notify writer
326 Atomics.store(this.int32, STDIN_SIZE_INDEX, 0);
327 Atomics.store(this.int32, STDIN_FLAG_INDEX, 0);
328 Atomics.notify(this.int32, STDIN_FLAG_INDEX);
329
330 return data;
331 }
332
333 /**
334 * Read next network message (returns null if none available)

Callers 1

startFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected