Valid message payloads in the list of messages to provide to try_send_message consist of strings (text messages) and bytes (binary messages).
This autogenerated function is called by the python interpreter when importing the module.
Drains all messages pending from all clients and returns them as a list[bytes]. Note that clients are not distinguished, so clients will have to self-identify in their messages, or the library will need to change to return messages per-client or bundled with client connection info.
Retrieves a List (Rust: Vec
Returns a string describing the nature of the last error the server encountered. No error has been detected if this function returns None.
Gets whether the server is running.
Requests that the websocket server shut down. The server will not shut down immediately but will stop serving as soon as e.g. it processes the shutdown request and any existing network requests are resolved.
Starts the websocket server.
Send messages to all connected clients. The socket stream is flushed after buffering each message in the argument List, so it’s better to call this once per ‘update,’ rather than calling this method multiple times if multiple messages are all available to be sent.