mirror of
https://github.com/Textualize/textual-web.git
synced 2025-10-17 02:36:40 +03:00
Requesting chunks from the Textual app
This commit is contained in:
@@ -422,11 +422,20 @@ class GanglionClient(Handlers):
|
||||
async def on_request_deliver_chunk(
|
||||
self, packet: packets.RequestDeliverChunk
|
||||
) -> None:
|
||||
"""The Ganglion server requested a chunk of a file."""
|
||||
"""The Ganglion server requested a chunk of a file. Forward that to the running app session.
|
||||
|
||||
When the meta is sent to the Textual app, it will be handled inside the WebDriver.
|
||||
"""
|
||||
route_key = RouteKey(packet.route_key)
|
||||
session_process = self.session_manager.get_session_by_route_key(route_key)
|
||||
if session_process is not None:
|
||||
await session_process.send_meta({"type": "deliver_file_chunk"})
|
||||
await session_process.send_meta(
|
||||
{
|
||||
"type": "deliver_chunk_request",
|
||||
"key": packet.delivery_key,
|
||||
"size": packet.chunk_size,
|
||||
}
|
||||
)
|
||||
|
||||
async def on_session_open(self, packet: packets.SessionOpen) -> None:
|
||||
route_key = packet.route_key
|
||||
|
||||
Reference in New Issue
Block a user