MCPcopy Create free account
hub / github.com/AimRT/AimRT / handle_callback

Function handle_callback

src/runtime/python_runtime/aimrt_py_chn.py:179–187  ·  view source on GitHub ↗
(ctx_ref: aimrt_python_runtime.ContextRef, msg_buf: bytes)

Source from the content-addressed store, hash-verified

177 py_pb_ts.SetSerializationTypesSupportedList(["pb", "json"])
178
179 def handle_callback(ctx_ref: aimrt_python_runtime.ContextRef, msg_buf: bytes):
180 try:
181 msg = _DeserializeProtobufMessage(msg_buf, ctx_ref.GetSerializationType(), msg_type)
182 if required_param_count == 1:
183 callback(msg)
184 else:
185 callback(ctx_ref, msg)
186 except Exception as e:
187 print(f"AimRT channel handle get exception, {e}", file=sys.stderr)
188
189 subscriber.PbSubscribeWithCtx(py_pb_ts, handle_callback)
190

Callers

nothing calls this directly

Calls 2

GetSerializationTypeMethod · 0.45

Tested by

no test coverage detected