@@ -37,6 +37,9 @@ class Download:
3737 Will be None if the content is binary.
3838 """
3939
40+ name : str | None = None
41+ """Optional name set bt the client."""
42+
4043 incoming_chunks : asyncio .Queue [bytes | None ] = field (default_factory = asyncio .Queue )
4144 """A queue of incoming chunks for the download.
4245 Chunks are sent from the app service to the download handler
@@ -52,7 +55,7 @@ class DownloadManager:
5255 running app processes.
5356 """
5457
55- def __init__ (self ):
58+ def __init__ (self ) -> None :
5659 self ._active_downloads : dict [str , Download ] = {}
5760 """A dictionary of active downloads.
5861
@@ -73,6 +76,7 @@ async def create_download(
7376 open_method : str ,
7477 mime_type : str ,
7578 encoding : str | None = None ,
79+ name : str | None = None ,
7680 ) -> None :
7781 """Prepare for a new download.
7882
@@ -91,6 +95,7 @@ async def create_download(
9195 open_method ,
9296 mime_type ,
9397 encoding ,
98+ name = name ,
9499 )
95100
96101 async def download (self , delivery_key : str ) -> AsyncGenerator [bytes , None ]:
@@ -111,6 +116,7 @@ async def download(self, delivery_key: str) -> AsyncGenerator[bytes, None]:
111116 "type" : "deliver_chunk_request" ,
112117 "key" : delivery_key ,
113118 "size" : DOWNLOAD_CHUNK_SIZE ,
119+ "name" : download .name ,
114120 }
115121 )
116122
0 commit comments