Skip to main content

Module topic

Module topic 

Source
Expand description

astrs topic echo/hz/info/pub (blueprint §13, §17).

  astrs topic echo cam/frames   ─► TopicSubscribe ─► pushed `Data` frames ─► decode+print
  astrs topic hz   cam/frames   ─► TopicSubscribe ─► pushed `Data` frames ─► windowed rate
  astrs topic info cam/frames   ─► GetNodeInfo (+ optional --manifest)   ─► type/subscribers
  astrs topic pub  src/out '1'  ─► a dynamic-node attach, one `send_batch`

§Why echo/hz need debug: true

A tap is a copy of a local output the daemon must keep seeing bytes for, which is only cheap because it is opt-in (crate::command::param’s sibling module doc has nothing to say about this — see astrs-daemon’s tap module and blueprint §13 instead). The coordinator refuses TopicSubscribe for a dataflow whose manifest never set debug: true; this module surfaces that refusal exactly as the coordinator worded it (crate::error::CliError::Refused) rather than inventing a second message.

§pub attaches, it does not inject

There is no wire verb that hands the coordinator a byte string to splice into a running edge — see astrs-coordinator’s handlers::logs::topic_publish for why that gap is deliberate. astrs topic pub instead does what blueprint §8.3’s path: dynamic exists for: it connects to the local daemon as the named node (which the manifest must have declared with path: dynamic) and publishes through the ordinary node API. The “topic” a user names is therefore the producer port (dynamic_node/output), not a consumer’s input — exactly the shape astrs topic echo already expects a port reference in.

Structs§

HzWindow
A trailing window of arrival instants, for astrs topic hz’s rate math.
InfoReport
astrs topic info’s report.
PublishArgs
Arguments for publish.
PublishReport
What publish did.
StreamReport
What echo/hz did.
TopicStreamArgs
Arguments shared by echo and hz: a port reference, which dataflow it belongs to (defaulting to the cluster’s sole one), and how to reach the coordinator.

Functions§

echo
astrs topic echo: prints every message on a port as it arrives.
hex
See HEX_PREVIEW_LIMIT.
hz
astrs topic hz: reports a port’s observed message rate, recomputed every time a frame arrives from a trailing window (blueprint §17).
info
astrs topic info: a port’s declared type, its subscriber list (when a manifest is given), and a best-effort observed schema hash — obtained by opening a tap for INFO_PEEK_TIMEOUT and reporting whatever the first frame (if any) says, since a bare port carries no type marker of its own (blueprint §6.1).
parse_port
Parses the node/output shorthand every topic verb takes.
publish
astrs topic pub: publishes one message through a dynamic-node attach (see this module’s own docs for why pub cannot inject into an arbitrary running edge).
summarize_payload
Summarizes a payload for a human: the Arrow schema when it decodes, raw hex otherwise (blueprint §17: “raw hex fallback”).