command
Version:
v0.52.0
Opens a new window with list of versions in this module.
Published: Jun 19, 2026
License: MPL-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
sensor-pipeline
Periodic publisher and aggregating subscriber using TypedPublisher/TypedSubscriber with the JSON codec.
Pattern: telemetry fan-in — multiple sensor IDs publish on a single topic; one subscriber aggregates readings in real time.
Run
go run .
What it shows
| Concept |
Where |
TypedPublisher[T] + TypedSubscriber[T] |
wraps raw Publisher/Subscriber with a codec |
JSONCodec[T] |
zero-config marshalling for any struct |
WriteCtx |
context-aware write with cancellation support |
dds.DefaultQoS |
best-effort, volatile — appropriate for sensor streams |
Expected output
[sensor-A] 21.0°C (running avg: 21.00°C, n=1)
[sensor-B] 19.8°C (running avg: 20.40°C, n=2)
...
Final average over 10 readings: 22.56°C
Documentation
¶
sensor-pipeline demonstrates periodic publishing and aggregating subscription
using TypedPublisher/TypedSubscriber with the JSON codec.
Run with:
go run .
Source Files
¶
Click to show internal directories.
Click to hide internal directories.