MCPcopy
hub / github.com/benoitc/gunicorn / _async_read_exact

Method _async_read_exact

gunicorn/asgi/uwsgi.py:111–119  ·  view source on GitHub ↗

Read exactly size bytes asynchronously.

(self, size)

Source from the content-addressed store, hash-verified

109 self._set_body_reader()
110
111 async def _async_read_exact(self, size):
112 """Read exactly size bytes asynchronously."""
113 buf = bytearray()
114 while len(buf) < size:
115 chunk = await self.unreader.read(size - len(buf))
116 if not chunk:
117 break
118 buf.extend(chunk)
119 return bytes(buf)
120
121 def _set_body_reader(self):
122 """Set up body state for async reading."""

Callers 1

_async_parseMethod · 0.95

Calls 1

readMethod · 0.45

Tested by

no test coverage detected