MCPcopy Create free account
hub / github.com/wal-e/wal-e / _read_chunk

Method _read_chunk

wal_e/pipebuf.py:128–140  ·  view source on GitHub ↗
(self, sz)

Source from the content-addressed store, hash-verified

126 _setup_fd(self._fd)
127
128 def _read_chunk(self, sz):
129 chunk = None
130 try:
131 chunk = os.read(self._fd, sz)
132 self._bd.add(chunk)
133 except EnvironmentError as e:
134 if e.errno in [errno.EAGAIN, errno.EWOULDBLOCK]:
135 assert chunk is None
136 gevent.socket.wait_read(self._fd)
137 else:
138 raise
139
140 self.got_eof = (chunk == b'')
141
142 def read(self, size=None):
143 # Handle case of "read all".

Callers 1

readMethod · 0.95

Calls 2

addMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected