MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / feed_data

Method feed_data

aiohttp/_websocket/reader_c.py:173–187  ·  view source on GitHub ↗
(self, data: bytes | bytearray | memoryview)

Source from the content-addressed store, hash-verified

171 # and asyncio types this to Union[bytes, bytearray, memoryview] so we need
172 # coerce data to bytes if it is not
173 def feed_data(self, data: bytes | bytearray | memoryview) -> tuple[bool, bytes]:
174 if type(data) is not bytes:
175 data = bytes(data)
176
177 if self._exc is not None:
178 return True, data
179
180 try:
181 self._feed_data(data)
182 except Exception as exc:
183 self._exc = exc
184 set_exception(self.queue, exc)
185 return EMPTY_FRAME_ERROR
186
187 return EMPTY_FRAME
188
189 def _handle_frame(
190 self,

Callers 4

test_concurrent_messagesFunction · 0.95
_handle_frameMethod · 0.45

Calls 2

_feed_dataMethod · 0.95
set_exceptionFunction · 0.85