A wire format of RPC messages (Effect's RpcSerialization):
make_unsafe makes a parser per connection and codec_for the
codecs of the values inside messages.
Attributes#
| Attribute | Type | Description |
|---|---|---|
content_type | str = content_type | The HTTP content type of the frames. |
includes_framing | bool = includes_framing | Whether a frame can hold part of a message (so a stream can be split anywhere). |
codec_for | CodecFor |
|
Functions#
__init__#
__init__(make_unsafe, content_type, includes_framing, codec_for) -> None| Parameter | Type | Description |
|---|---|---|
make_unsafe | Callable[[], Parser] | |
content_type | str | |
includes_framing | bool | |
codec_for | CodecFor |
def __init__(
self,
make_unsafe: Callable[[], Parser],
content_type: str,
includes_framing: bool,
codec_for: CodecFor,
) -> None:
self._make_unsafe = make_unsafe
self.content_type = content_type
self.includes_framing = includes_framing
self._codec_for = codec_formake_unsafe#
make_unsafe() -> ParserA new parser, holding the state of one connection (a partly
received frame, say). Its decode raises on malformed data, or
MaxBufferSizeExceeded when a framed format holds more than its
buffer limit of an unfinished message.
Returns Parser
def make_unsafe(self) -> Parser:
"""A new parser, holding the state of one connection (a partly
received frame, say). Its ``decode`` raises on malformed data, or
``MaxBufferSizeExceeded`` when a framed format holds more than its
buffer limit of an unfinished message."""
return self._make_unsafe()