Template Function ros2_medkit_gateway::fan_out_collectionļ
Defined in File fan_out_helpers.hpp
Function Documentationļ
-
template<class T>
inline FanOutResult<T> ros2_medkit_gateway::fan_out_collection(AggregationManager *agg, const httplib::Request &req)ļ Typed fan-out for collection endpoints. Replacement for merge_peer_items that returns parsed
Titems instead of mutating a raw JSON document.Behavior parity with merge_peer_items:
null
agg,X-Medkit-No-Fan-Outheader, or zero healthy peers all short-circuit to an empty result (no fan-out attempted).per-entity paths consult the routing/contributor tables to target only the peers that host the entity; global paths fan out to all healthy peers.
peer failures are surfaced via
partial+failed_peers.
New behavior:
peer items are parsed via
dto::JsonReader<T>rather than copied as raw JSON. Items that fail validation are dropped fromitemsand recorded indropped_itemswith the JsonReader error message plus a best-effortsource_id. A WARN is logged for each drop.the
peerfield on each DroppedItem is left empty in this commit because AggregationManager::fan_out_get coalesces all peer responses into onemerged_itemsarray without per-item provenance. Future work can thread per-peer attribution through if needed.