INNER CODE UNIT · Python

receive_with_msgpack

florimondmanca/msgpack-asgi · src/msgpack_asgi/_middleware.py:92

    async def receive_with_msgpack(self) -> Message:
        message = await self._receive()

        if message["type"] != "http.request":
            # Could be http.disconnect
            return message

        if not self._should_decode_from_msgpack_to_json:
            return message

        if self._allow_naive_streaming:
            body_buffer = io.BytesIO()

            while True:
                body_buffer.write(message["body"])

                if not message.get("more_body", False):
                    break

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…