mini_apps.websocket_server

class mini_apps.websocket_server.AutoId

Bases: object

Class that automatically assigns an incrementing ID on construction

class mini_apps.websocket_server.Client(socket)

Bases: AutoId

Client object, contains a socket for the connection and a user for data

class mini_apps.websocket_server.WebsocketServer(host, port, apps)

Bases: LogSource

Class that runs the websocket server and dispatches incoming messages to the installed apps

async run()

Runs the websocket server

async socket_handler(socket)

Main entry point for socket connections

async socket_messages(client: Client)

Generator that yields messages from the socket

stop()

Stops self.run()