sensor-pipeline

command
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

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

Overview

sensor-pipeline demonstrates periodic publishing and aggregating subscription using TypedPublisher/TypedSubscriber with the JSON codec.

Run with:

go run .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL