MCPcopy
hub / github.com/tornadoweb/tornado / read_from_fd

Method read_from_fd

tornado/iostream.py:301–314  ·  view source on GitHub ↗

Attempts to read from the underlying file. Reads up to ``len(buf)`` bytes, storing them in the buffer. Returns the number of bytes read. Returns None if there was nothing to read (the socket returned `~errno.EWOULDBLOCK` or equivalent), and zero on EOF. .. v

(self, buf: Union[bytearray, memoryview])

Source from the content-addressed store, hash-verified

299 raise NotImplementedError()
300
301 def read_from_fd(self, buf: Union[bytearray, memoryview]) -> Optional[int]:
302 """Attempts to read from the underlying file.
303
304 Reads up to ``len(buf)`` bytes, storing them in the buffer.
305 Returns the number of bytes read. Returns None if there was
306 nothing to read (the socket returned `~errno.EWOULDBLOCK` or
307 equivalent), and zero on EOF.
308
309 .. versionchanged:: 5.0
310
311 Interface redesigned to take a buffer and return a number
312 of bytes instead of a freshly-allocated object.
313 """
314 raise NotImplementedError()
315
316 def get_fd_error(self) -> Optional[Exception]:
317 """Returns information about any error on the underlying file.

Callers 1

_read_to_bufferMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected