Skip to content

Per-process manifest for targeted snapshot requests - #13

Merged
bricke merged 3 commits into
mainfrom
manifest
Apr 30, 2026
Merged

bricke merged 3 commits into
mainfrom
manifest

Conversation

@bricke

@bricke bricke commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • bacaro_new gains an optional second argument: a NULL-terminated array of domain strings the process publishes (e.g. {"sensors", "power", nullptr})
  • At startup, a .manifest file is written alongside .pub and .rep; it is cleaned up on bacaro_destroy
  • When a peer is discovered, its manifest (if present) is read and stored in PeerInfo
  • DEALER socket creation and snapshot requests are skipped for peers whose declared domains don't overlap with the local subscriptions — reducing unnecessary connections at boot
  • Backwards compatible: passing nullptr preserves existing behaviour exactly

Why

On a device with many processes, every subscriber used to send snapshot requests to every peer at discovery, even when there was no domain overlap. The manifest lets processes declare what they publish at startup so peers can skip those handshakes entirely.

Test plan

  • All existing tests pass (ctest)
  • No manifest (nullptr) behaves as before
  • Overlapping subscription creates DEALER and receives snapshot
  • Non-overlapping subscription skips DEALER entirely
  • Hierarchical domain overlap (parent/child prefix) works correctly
  • manifest_overlaps unit tests cover exact match, child, parent, empty prefix, and no-overlap cases

bricke added 3 commits April 29, 2026 18:20
Optional NULL-terminated domain list in bacaro_new() lets peers skip
DEALER creation and snapshot requests when subscriptions don't overlap
with the publisher's declared domains. Backwards compatible: passing
nullptr preserves existing behaviour.
@bricke
bricke merged commit 0d9e838 into main Apr 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant