Skip to content

Pub/Sub for SSE channels #1914

Closed
Closed

Description

@bpamiri

Phase 3 — Modernization Target #10

Add a channel abstraction over the existing SSE implementation with pub/sub support.

Design

// Controller — subscribe
function notifications() {
    subscribeToChannel(channel="user.#params.userId#", events="notification,alert");
}

// Publish from anywhere
publish(channel="user.42", event="notification", data=SerializeJSON({
    title: "New message", body: "You have a new message"
}));
  • In-memory pub/sub for single-server (wheels.Channel)
  • DatabaseAdapter for multi-server via _wheels_events table
  • subscribeToChannel() controller method wrapping initSSEStream()
  • Global publish() function
  • Ship wheels-sse.js client library for auto-reconnect

Backwards Compatibility

Existing renderSSE() / initSSEStream() / sendSSEEvent() API continues to work. Channels are a higher-level abstraction.

See design_docs/MODERNIZE-WHEELS-RIM.md §4.8 for full implementation plan.

Activity

  1. added 2 commits that reference this issue on Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions