Skip to content

Add YANG notification subscription with circular buffer#35

Open
sha90w wants to merge 1 commit into
holo-routing:mainfrom
sha90w:notification-sub
Open

Add YANG notification subscription with circular buffer#35
sha90w wants to merge 1 commit into
holo-routing:mainfrom
sha90w:notification-sub

Conversation

@sha90w

@sha90w sha90w commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Subscribe to notifications from holod via the streaming Subscribe RPC. A background receiver thread with its own gRPC connection and tokio runtime pushes received notifications into a fixed-size circular buffer (1024 entries).

New commands:

  • notification start: subscribe to all YANG notifications
  • notification stop: unsubscribe (buffer contents are kept)
  • show notifications: print buffered notifications (pager/pipe aware)

Notifications are rendered as human-readable one-line summaries: the JSON payload is parsed against the YANG schema
(DataOperation::NotificationYang) and all leaf values are flattened into a single 'name=value' line, uniformly for every notification defined in the loaded modules. Ancestor list keys (e.g. the BGP neighbor's remote-address) appear automatically. Entries that fail to parse fall back to a one-line raw JSON dump; the raw format is also available via 'show notifications json'.

Subscribe to notifications from holod via the streaming Subscribe RPC.
A background receiver thread with its own gRPC connection and tokio
runtime pushes received notifications into a fixed-size circular
buffer (1024 entries).

New commands:
- notification start: subscribe to all YANG notifications
- notification stop: unsubscribe (buffer contents are kept)
- show notifications: print buffered notifications (pager/pipe aware)

Notifications are rendered as human-readable one-line summaries: the
JSON payload is parsed against the YANG schema
(DataOperation::NotificationYang) and all leaf values are flattened
into a single 'name=value' line, uniformly for every notification
defined in the loaded modules. Ancestor list keys (e.g. the BGP
neighbor's remote-address) appear automatically. Entries that fail to
parse fall back to a one-line raw JSON dump; the raw format is also
available via 'show notifications json'.

Cargo.lock: sync yang5 to 0.2 per the earlier Cargo.toml bump.
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