Skip to content

feat: add subscribeChanges WebSocket endpoint for real-time change streaming#35

Merged
maxine-at-forecast merged 3 commits intodevelopfrom
feature/realtime-change-stream-subscribechanges
Feb 26, 2026
Merged

feat: add subscribeChanges WebSocket endpoint for real-time change streaming#35
maxine-at-forecast merged 3 commits intodevelopfrom
feature/realtime-change-stream-subscribechanges

Conversation

@maxine-at-forecast
Copy link
Copy Markdown
Contributor

Summary

  • Adds an in-memory broadcast event bus (changestream.py) with bounded replay buffer and per-subscriber queues
  • Hooks into ingestion/processor.py to publish change events after successful upserts/deletes
  • New WebSocket endpoint at /xrpc/science.alt.dataset.subscribeChanges with optional cursor-based replay
  • 21 new tests covering the event bus, processor integration, WebSocket subscribe/replay/disconnect/concurrency

Test plan

  • All 164 tests pass (uv run pytest)
  • Lint clean (uv run ruff check src/ tests/)
  • Manual test: connect via WebSocket, publish a record, verify event arrives
  • Verify cursor replay works with pre-populated buffer
  • Verify slow subscribers get events dropped (not unbounded queue growth)

🤖 Generated with Claude Code

maxinelevesque and others added 3 commits February 26, 2026 01:44
…reaming

Introduces an in-memory broadcast event bus (changestream.py) that the
ingestion processor publishes to after successful upserts/deletes. A new
WebSocket endpoint at /xrpc/science.alt.dataset.subscribeChanges streams
these events to subscribers with cursor-based replay from a bounded buffer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hange-stream-subscribechanges

# Conflicts:
#	CHANGELOG.md
@maxine-at-forecast maxine-at-forecast merged commit 3283a22 into develop Feb 26, 2026
9 checks passed
@maxine-at-forecast maxine-at-forecast deleted the feature/realtime-change-stream-subscribechanges branch February 26, 2026 15:01
@maxine-at-forecast maxine-at-forecast linked an issue Feb 26, 2026 that may be closed by this pull request
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.

Real-time change stream: subscribeChanges endpoint

2 participants