websockets.client
Classes
dict() -> new empty dictionary |
Functions
|
Wait for an OK from the server. |
|
Registers for broadcast messages. |
|
Authenticates with the given token. |
|
Broadcasts the given message to all connected clients. |
|
Receives the status of the server. |
Module Contents
- class websockets.client.StatusMessage[source]
Bases:
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)
- async websockets.client.acknowledged(websocket: websockets.asyncio.client.ClientConnection) None [source]
Wait for an OK from the server.
- async websockets.client.register(websocket: websockets.asyncio.client.ClientConnection, schema: str, channel: str | None) None [source]
Registers for broadcast messages.
- async websockets.client.authenticate(websocket: websockets.asyncio.client.ClientConnection, token: str) None [source]
Authenticates with the given token.
- async websockets.client.broadcast(websocket: websockets.asyncio.client.ClientConnection, schema: str, channel: str | None, message: onegov.core.types.JSON_ro, groupids: list[str] | None = None) None [source]
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.
- async websockets.client.status(websocket: websockets.asyncio.client.ClientConnection) StatusMessage | None [source]
Receives the status of the server.
Assumes prior authentication.