MCPcopy Index your code
hub / github.com/python/cpython / readAsync

Function readAsync

Platforms/emscripten/web_example_pyrepl_jspi/src.mjs:125–137  ·  view source on GitHub ↗
(stream, buffer, offset, length, pos /* ignored */)

Source from the content-addressed store, hash-verified

123
124const tty_stream_ops = {
125 async readAsync(stream, buffer, offset, length, pos /* ignored */) {
126 let readBytes = PTY.read(length);
127 if (length && !readBytes.length) {
128 const status = await waitForReadable(-1);
129 if (status === waitResult.READY) {
130 readBytes = PTY.read(length);
131 } else {
132 throw new Error("Not implemented");
133 }
134 }
135 buffer.set(readBytes, offset);
136 return readBytes.length;
137 },
138
139 write: (stream, buffer, offset, length) => {
140 // Note: default `buffer` is for some reason `HEAP8` (signed), while we want unsigned `HEAPU8`.

Callers

nothing calls this directly

Calls 3

waitForReadableFunction · 0.85
readMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…