Advanced behavior and implementation boundaries
Events and streams
The framework has two distinct streaming mechanisms. GrpcClient.subscribe(topic=..., once=False, source="") uses Events/Subscribe and receives EventBus payloads. A control object may implement _set_event_bus(bus) to receive the server’s bus; ImageStreamGrpcService illustrates publishing JPEG frames to a topic and the image client decodes frames locally. Separately, GrpcClient.stream_call(method_name, *args, **kwargs) calls Control/StreamCall against a server configured with stream_obj=.... stream_obj is distinct from ctrl_obj; it is not included in ordinary Describe dynamic binding.
The A&D reader sample uses prepare_event_measurement() to combine multiple remote calls (stream_start, event_set_config, set_trigger_mode, event_arm) and wait_event() to consume a single event. Those methods are application-specific conveniences, not grpc_frame APIs.
Synchronous and asynchronous clients
SyncGrpcClient is the synchronous interface. AsyncGrpcClient wraps dynamically discovered synchronous RPC calls using loop.run_in_executor(None, ...); it is not a native grpc.aio implementation. Application methods that call asynchronous remote methods must await them. The A&D reader’s async wrapper demonstrates this pattern.
Data transport and safety
adapter attempts JSON serialization first (including tagged tuples and base64 bytes), falling back to Python pickle when JSON is unavailable. Only communicate with trusted peers: unpickling arbitrary data is unsafe. Serialization is not general object identity preservation. The framework exposes public callable methods by name; Describe excludes properties, but this is not a method-level authorization system. Restrict network access and do not expose arbitrary device controls to untrusted clients.
COM-bound controls
The included grpc_com module provides ComExecutionRunner, ThreadSafeCtrlProxy, and create_com_grpc_server. COM device creation and method execution must occur on the same dedicated thread, rather than arbitrary gRPC worker threads. Use that module for thread-affine COM controls instead of passing a COM object directly to a generic worker pool.
Type hints
Dynamic runtime binding does not automatically provide static type information. The repository’s make_pyi tooling generates client .pyi stubs from a client class and the underlying control class. The A&D reader’s make_pyi.py shows both sync and async generation. Generate stubs; do not maintain them manually.
Observed implementation limitations
In the provided grpc_client.py, the grpc_options argument of SyncGrpcClient and AsyncGrpcClient is accepted but not forwarded to the base constructor. The underlying GrpcClient accepts the options. Avoid claiming large-message options work through the derived constructors until this is corrected in the framework. Likewise, method names matching existing client methods can shadow client APIs during dynamic binding; inspect _method_table and use deliberate post-initialization rebinding when necessary.