mirror of
https://github.com/Textualize/textual-serve.git
synced 2025-10-17 02:50:37 +03:00
Swap msgpack for binary encode
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import msgpack
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
@@ -14,6 +13,7 @@ from importlib.metadata import version
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from textual_serve.download_manager import DownloadManager
|
from textual_serve.download_manager import DownloadManager
|
||||||
|
from textual_serve._binary_encode import load as binary_load
|
||||||
|
|
||||||
log = logging.getLogger("textual-serve")
|
log = logging.getLogger("textual-serve")
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ class AppService:
|
|||||||
Args:
|
Args:
|
||||||
payload: Encoded packed data.
|
payload: Encoded packed data.
|
||||||
"""
|
"""
|
||||||
unpacked = msgpack.unpackb(payload)
|
unpacked = binary_load(payload)
|
||||||
if unpacked[0] == "deliver_chunk":
|
if unpacked[0] == "deliver_chunk":
|
||||||
# If we receive a chunk, hand it to the download manager to
|
# If we receive a chunk, hand it to the download manager to
|
||||||
# handle distribution to the browser.
|
# handle distribution to the browser.
|
||||||
|
|||||||
Reference in New Issue
Block a user