Expand description
Per-request metadata handed to a service callback — rclrs’s ServiceInfo.
Issue 1942. rclrs 0.7 can pass a service callback a ServiceInfo beside the
request: who sent it (the client’s GID and its sequence number, together
the upstream rmw_request_id_t) and when (source and received timestamps).
This is the counterpart, registered through Node::create_service_with_info
or node.service(name).service_info().
Not to be confused with nros_rmw::ServiceInfo, the RMW seam’s service
DESCRIPTOR (name, type, hash, domain). That type is not re-exported by the
nros facade (RFC-0071 D12, phase-506 W1), which is what lets this one take
rclrs’s name there.
§What a backend reports
Every field is an Option, because whether a request carries it is a
BACKEND property, and a backend that cannot say leaves the field None
rather than inventing a value — the MessageInfo precedent, where a backend
that reports no metadata hands the callback None instead of a zeroed
struct. rclrs’s fields are not optional; ours are, and that is the one
shape divergence.
| backend | request_id | source_timestamp | received_timestamp |
|---|---|---|---|
| zenoh | from the query attachment (rmw_zenoh_cpp layout) | from the attachment | the queryable callback’s wall-clock stamp |
| Cyclone DDS | request header guid + publication handle, header seq (stock rmw_cyclonedds_cpp’s layout) | the DDS sample’s source timestamp | None (Cyclone 0.10 has none) |
| XRCE-DDS | the Agent’s SampleIdentity (client writer GUID + sequence) | None | the request callback’s wall-clock stamp |
a C-ABI backend without take_request_with_info | None | None | None |
received_timestamp is upstream’s: the server’s wall clock (ns since the
Unix epoch) when the request arrived (issue 2135); None on a platform
with no wall clock.
A C-ABI backend reports through the vtable’s take_request_with_info slot
(issue 2081), whose rmw_service_info_t spells “not reported” as zero; the
runtime turns each zero into None.
Structs§
- Request
Id - Identity of one service request — rclrs’s
RequestId, upstream’srmw_request_id_t. - Service
Info - Metadata about one received service request — rclrs’s
ServiceInfo.
Constants§
- REQUEST_
WRITER_ GUID_ SIZE - Width of
RequestId::writer_guid, in bytes.