Renaming to account for binary encoding scheme

This commit is contained in:
Darren Burns
2024-08-21 10:45:05 +01:00
parent 5acb4491fa
commit 1ec4366a6c
2 changed files with 7 additions and 7 deletions

View File

@@ -196,7 +196,7 @@ class AppSession(Session):
META = b"M"
DATA = b"D"
PACKED = b"P"
BINARY_ENCODED = b"P"
stderr_data = io.BytesIO()
@@ -217,7 +217,7 @@ class AppSession(Session):
on_data = self._connector.on_data
on_meta = self._connector.on_meta
on_packed = self._connector.on_packed
on_binary_encoded_message = self._connector.on_binary_encoded_message
try:
ready = False
for _ in range(10):
@@ -242,8 +242,8 @@ class AppSession(Session):
await self.send_meta({"type": meta_type})
else:
await on_meta(json.loads(payload))
elif type_bytes == PACKED:
await on_packed(payload)
elif type_bytes == BINARY_ENCODED:
await on_binary_encoded_message(payload)
except IncompleteReadError:
# Incomplete read means that the stream was closed

View File

@@ -22,11 +22,11 @@ class SessionConnector:
meta: Mapping of meta information.
"""
async def on_packed(self, payload: bytes) -> None:
"""Handle data packed with msgpack from session.
async def on_binary_encoded_message(self, payload: bytes) -> None:
"""Handle binary encoded data from the process.
Args:
payload: Msgpack data to handle.
payload: Binary encoded data to handle.
"""
async def on_close(self) -> None: