examples/stream-render/README.md
Note: This is the Render-optimized version of the stream example. It adds a production HTTP server, Vite build, and a
render.yamlBlueprint for deploying to Render.
Example project demonstrating real-time top-K stream processing.
git clone https://github.com/rivet-dev/rivet.git
cd rivet/examples/stream
npm install
npm run dev
This stream processor uses a Top-K algorithm to efficiently maintain the top 3 values using insertion sort. Updates are instantly sent to all connected clients via event broadcasting.
src/actors.ts): streamProcessor maintaining a sorted top-3 leaderboard with broadcast updatessrc/server.ts): Hono app routing /api/rivet/* to the registry handlerfrontend/app/App.tsx): useActor hook with live stats and event-driven UIexamples/stream-render if deploying from the monorepo.| Variable | Description |
|---|---|
RIVET_ENDPOINT | Backend endpoint URL from your Rivet Cloud project |
RIVET_PUBLIC_ENDPOINT | Public endpoint URL from your Rivet Cloud project |
RIVET_ENVOY_VERSIONis automatically derived from Render'sRENDER_GIT_COMMIT— no manual bump needed per deploy. Set it explicitly to override.
MIT