qmi.core.context_singleton.make_rpc_object
- qmi.core.context_singleton.make_rpc_object(rpc_object_name: str, rpc_object_class: type[QMI_RpcObject], *args: Any, **kwargs: Any) Any
Create an instance of a QMI_RpcObject subclass and make it accessible via RPC.
The actual object instance will be created in a separate background thread. To access the object, you can call its methods via RPC. Note that using the returned proxy in a thread might require casting it first: proxy = cast(proxy, rpc_object_class)(qmi.context(), rpc_object_name).
- Parameters:
rpc_object_name – Unique name for the new object instance. This name will also be used to access the object via RPC.
rpc_object_class – Class that implements this object (must be a subclass of QMI_RpcObject).
args – Optional arguments for the object class constructor.
kwargs – Optional keyword arguments for the object class constructor.
- Returns:
An RPC proxy that provides access to the new object instance.
- Raises:
QMI_NoActiveContextException – If there is no active QMI context present.