runtimepy.net.server.websocket package#
Submodules#
runtimepy.net.server.websocket.data module#
A module implementing a binary data connection for the package’s WebSocket server interface.
- class runtimepy.net.server.websocket.data.RuntimepyDataWebsocketConnection(protocol: ClientConnection | ServerConnection, **kwargs)[source]#
Bases:
StringMessageConnection,WebsocketConnectionA class implementing a WebSocket connection for streaming raw data.
- runtimepy.net.server.websocket.data.data_connection_future(guid: str) Future[RuntimepyDataWebsocketConnection][source]#
Get a future for a data connection guid.
runtimepy.net.server.websocket.state module#
A module implementing a stateful data interface for per-connection tabs.
- class runtimepy.net.server.websocket.state.TabState(shown: bool, tab_logger: ListLogger, points: dict[str, list[tuple[str | int | float | bool, int]]], primitives: dict[str, Int8Primitive | Int16Primitive | Int32Primitive | Int64Primitive | Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive | HalfPrimitive | FloatPrimitive | DoublePrimitive | BooleanPrimitive], callbacks: dict[str, int], latest_ui_values: dict[str | int, bool | int | float | str], _loggers: list[Logger], binary: ByteFifo)[source]#
Bases:
objectStateful information relevant to individual tabs.
- binary: ByteFifo#
- callbacks: dict[str, int]#
- frame(time: float, data_connection: RuntimepyDataWebsocketConnection | None = None) dict[str, Any][source]#
Handle a new UI frame.
- latest_ui_values: dict[str | int, bool | int | float | str]#
- points: dict[str, list[tuple[str | int | float | bool, int]]]#
- primitives: dict[str, Int8Primitive | Int16Primitive | Int32Primitive | Int64Primitive | Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive | HalfPrimitive | FloatPrimitive | DoublePrimitive | BooleanPrimitive]#
- shown: bool#
- tab_logger: ListLogger#
Module contents#
A module implementing a simple WebSocket server for the package.
- class runtimepy.net.server.websocket.RuntimepyWebsocketConnection(protocol: ClientConnection | ServerConnection, **kwargs)[source]#
Bases:
WebsocketJsonMessageConnectionA class implementing a package-specific WebSocket connection.
- data_connection: RuntimepyDataWebsocketConnection | None#
- poll_connection_metrics: bool#
- poll_governor: RateLimiter#
- send_interfaces: dict[str, Callable[[dict[str, Any]], None]]#
- tab_sender(name: str) Callable[[dict[str, Any]], None][source]#
Get a tab message-sending interface.
- ui_time: float#