Skip to content

Feat/rtdb live streaming rhino#21

Merged
jckenny59 merged 4 commits intomainfrom
feat/rtdb-live-streaming-rhino
Mar 27, 2026
Merged

Feat/rtdb live streaming rhino#21
jckenny59 merged 4 commits intomainfrom
feat/rtdb-live-streaming-rhino

Conversation

@jckenny59
Copy link
Copy Markdown
Collaborator

@jckenny59 jckenny59 commented Mar 14, 2026

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (for example doc update, configuration, etc)

Summary

This draft PR introduces streaming support for Firebase Realtime Database and adds a dedicated Grasshopper component for live subscriptions.

Main additions:

  • Added streaming support to the RealtimeDatabase module:
    • stream registration and lifecycle tracking
    • stream close by id and close all streams
    • normalized stream message handling for event, path, and data
  • Added a new GH component bundle:
    • Cx_StreamRealtimeDatabase/code.py
    • Cx_StreamRealtimeDatabase/metadata.json
  • Added manual streaming test utilities for local verification:
    • tests/database/random_testing.py
    • tests/database/stream_event_trigger.py

Behavior notes:

  • The GH component supports live streaming with outputs for event, event_path, and data.
  • The component supports returning either raw event payloads or full data from the subscribed node (configurable by input).
  • Stream lifecycle is handled through a background worker pattern compatible with existing GH components.

Important reviewer note

This PR intentionally does not update ProjectManager for streaming behavior.

Reason:

  • The current ProjectManager integration strategy should be reviewed first before introducing stream-driven logic there.
  • I would prefer aligning on API before wiring streaming into ProjectManager.

Checklist

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (for example Added, Changed, Removed).
  • I ran all tests on my computer and it is all green (invoke test).
  • I ran lint on my computer and there are no errors (invoke lint).
  • I added new functions/classes and made them available on a second-level import.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate).

Draft status and review request

This PR is intentionally opened as Draft for early design feedback on:

  • stream API surface
  • GH component UX
  • expected output mode defaults (raw event payload vs full node data)

PR comment

I intentionally did not update ProjectManager in this PR.
I think we should first align on how streaming should be integrated there (ownership, lifecycle, and API shape), and then do a focused follow-up change once we agree.

This adds the base level of streaming to the Realtime Database class and enables it to stream changes at a realtime database path.
This includes the creation of a basic stream component in GH. This enables the user to steam any information from the database itself.
This includes testing the GH component rebuild just to ensure that everything builds successfully.
@jckenny59 jckenny59 changed the base branch from main to refactor/string-paths-storage-rtdb March 14, 2026 22:01
@jckenny59 jckenny59 requested a review from gonzalocasas March 14, 2026 22:01
Copy link
Copy Markdown
Member

@gonzalocasas gonzalocasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

Base automatically changed from refactor/string-paths-storage-rtdb to main March 27, 2026 15:43
@jckenny59 jckenny59 marked this pull request as ready for review March 27, 2026 15:43
@jckenny59 jckenny59 merged commit b86e6fb into main Mar 27, 2026
13 of 14 checks passed
@jckenny59 jckenny59 deleted the feat/rtdb-live-streaming-rhino branch March 27, 2026 15:45
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.

2 participants