bundle.website.core.ws_messages

Typed websocket message helpers shared by website pages.

Attributes

Classes

WebSocketDataMixin

Mixin that adds async websocket send/receive helpers to Data models.

DownloaderStartMessage

Download progress message emitted when transfer starts.

DownloaderUpdateMessage

Download progress message emitted while bytes are received.

DownloaderEndMessage

Download progress message emitted when transfer completes.

Module Contents

bundle.website.core.ws_messages.MessageT
class bundle.website.core.ws_messages.WebSocketDataMixin

Mixin that adds async websocket send/receive helpers to Data models.

async send(websocket: fastapi.WebSocket) None
classmethod receive(websocket: fastapi.WebSocket) MessageT
Async:

class bundle.website.core.ws_messages.DownloaderStartMessage(/, **data: Any)

Bases: bundle.core.data.Data, WebSocketDataMixin

Download progress message emitted when transfer starts.

type: Literal['downloader_start'] = 'downloader_start'
total: int = None
class bundle.website.core.ws_messages.DownloaderUpdateMessage(/, **data: Any)

Bases: bundle.core.data.Data, WebSocketDataMixin

Download progress message emitted while bytes are received.

type: Literal['downloader_update'] = 'downloader_update'
progress: int = None
class bundle.website.core.ws_messages.DownloaderEndMessage(/, **data: Any)

Bases: bundle.core.data.Data, WebSocketDataMixin

Download progress message emitted when transfer completes.

type: Literal['downloader_end'] = 'downloader_end'