bundle.website.core.downloader

Downloader adapter that emits progress updates over websocket.

Classes

DownloaderWebSocket

Downloader implementation that streams progress to a websocket client.

Module Contents

class bundle.website.core.downloader.DownloaderWebSocket(/, **data: Any)

Bases: bundle.core.Downloader

Downloader implementation that streams progress to a websocket client.

websocket: fastapi.WebSocket | None = None
async set_websocket(websocket: fastapi.WebSocket) None

Attach the websocket used for progress event emission.

async start(byte_size: int) None

Emit transfer start with the total expected byte size.

async update(byte_count: int) None

Emit incremental download progress.

async end() None

Emit transfer completion to the websocket progress channel.