Skip to content

Add runnable WebSocket and SSE examples with a live browser client - #118

Merged
forhappy merged 3 commits into
mainfrom
codex/streaming-examples
Oct 25, 2026
Merged

forhappy merged 3 commits into
mainfrom
codex/streaming-examples

Conversation

@forhappy

@forhappy forhappy commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Add the same streaming application in Rust, Python, JavaScript and TypeScript, with a browser page that makes messages visible as they arrive.

The page at / connects to a worker or hibernating cell WebSocket, sends text and binary frames, and logs outgoing messages and incoming echoes with timestamps. A separate SSE panel consumes named progress/done events through EventSource. It closes the finite feed on done, supports restarting and clearing logs, bounds each log to 100 entries, and uses text nodes for message content. The cell's stored message count updates after received echoes and can be refreshed for other clients' writes. Each socket echoes its own messages; this example does not broadcast between connections.

All four project configurations serve the same dependency-free browser assets through the native asset pipeline while /events, /ws and /rooms/* retain application routing. The walkthrough includes explicit handler registration, curl/browser clients, a Node network check, and a smoke runner that restarts each backend and verifies recovered counts. JavaScript and Python CI run their corresponding examples.

Validation passed locally:

  • Built all four host binaries and the TypeScript bundle/module outputs; strict Clippy checks for the added Rust binaries.
  • Real network, asset delivery and restart/shutdown smoke checks for Rust, Node JavaScript, Node TypeScript, embedded V8 and CPython 3.14.
  • Browser interaction checks for cell/worker echoes, Unicode/binary frames, SSE completion/restart and clearing logs; desktop/mobile screenshot inspection, no horizontal overflow at 390px, and zero automated accessibility violations after fixes.
  • Linux loader probes reproduce the conflicting Python 3.14.8/3.14.5 bootstrap and pass with the selected managed library for both 3.14.5 and 3.14.5t; the Python streaming/restart test passes with the corrected launcher.
  • HTML/CSS/JS formatting, JavaScript/TypeScript executable parity, Python syntax, workflow YAML parsing, Rust formatting/module layout, native-only dependency boundaries, documentation links and diff whitespace checks.

The guide explains invocation ownership, backpressure, output gates and hibernation. Network connections do not survive process restart, and SSE history/replay remains application-owned. The finite progress feed emits without an artificial UI delay.

@forhappy forhappy changed the title Add runnable WebSocket and SSE examples across SDK languages Add runnable WebSocket and SSE examples with a live browser client Oct 25, 2026
Prefer the selected managed libpython for the unpackaged host.
The setup-python library otherwise overrides it and breaks bootstrap
imports against a different standard library.
@forhappy
forhappy merged commit 9f8de83 into main Oct 25, 2026
14 of 19 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