websockets.client ================= .. py:module:: websockets.client Classes ------- .. autoapisummary:: websockets.client.StatusMessage Functions --------- .. autoapisummary:: websockets.client.acknowledged websockets.client.register websockets.client.authenticate websockets.client.broadcast websockets.client.status Module Contents --------------- .. py:class:: StatusMessage Bases: :py:obj:`TypedDict` dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) .. py:attribute:: connections :type: dict[str, int] .. py:function:: acknowledged(websocket: websockets.asyncio.client.ClientConnection) -> None :async: Wait for an OK from the server. .. py:function:: register(websocket: websockets.asyncio.client.ClientConnection, schema: str, channel: str | None) -> None :async: Registers for broadcast messages. .. py:function:: authenticate(websocket: websockets.asyncio.client.ClientConnection, token: str) -> None :async: Authenticates with the given token. .. py:function:: broadcast(websocket: websockets.asyncio.client.ClientConnection, schema: str, channel: str | None, message: onegov.core.types.JSON_ro, groupids: list[str] | None = None) -> None :async: Broadcasts the given message to all connected clients. Optionally can be filtered to a list of groupids, for users with a lower privilege level like editors or members. admins will always receive all broadcasts in channels they've subscribed to. Assumes prior authentication. .. py:function:: status(websocket: websockets.asyncio.client.ClientConnection) -> StatusMessage | None :async: Receives the status of the server. Assumes prior authentication.