Dstar.Page.Plug (dstar v0.1.0-alpha.2)

Copy Markdown View Source

The plug behind Dstar.Router.dstar/2. Drives Dstar.Page callbacks:

  • {:page, Module} — GET: mount/2 then render/1 through Phoenix's view pipeline (root layout, flash, page_title all apply).
  • {:event, Module} — POST _event/:event: reads signals, starts SSE, calls handle_event/3.
  • {:stream, Module} — POST: starts SSE (deduped when stream_key/1 is defined), calls handle_connect/2, then owns the receive loop dispatching to handle_info/2.

All control flow lives here as plain functions — pages contain only callbacks.