Module: Magik::Realtime
- Defined in:
- lib/magik/realtime.rb
Overview
Opt-in realtime. Default is plain request/response; nothing costs anything until a
screen declares live or a channel exists.
Implements: Phase 3 — Realtime (opt-in) of docs/idea/00-build-spec.md.
Planned DSL surface, copied from the spec:
* `live :state_var, on: "channel:name"`
* `channel :name do subscribe_to/on_create/on_update end`
* `broadcast "channel", :event, payload`
* `presence for online/cursor tracking`
* `backend: Postgres LISTEN/NOTIFY (default) → Redis pub/sub (swap via config)`
Status: Not implemented — spec only. Every entry point below raises NotImplementedError. Nothing here reads config, touches a database or emits a byte of HTML.
Constant Summary collapse
- SPEC_PHASE =
The build-spec phase this subsystem implements.
"Phase 3 — Realtime (opt-in)"- DSL_SURFACE =
The DSL this subsystem will expose, verbatim from the spec.
[ "live :state_var, on: \"channel:name\"", "channel :name do subscribe_to/on_create/on_update end", "broadcast \"channel\", :event, payload", "presence for online/cursor tracking", "backend: Postgres LISTEN/NOTIFY (default) → Redis pub/sub (swap via config)" ].freeze
- STATUS =
Implementation status of this subsystem.
"Not implemented — spec only"
Class Method Summary collapse
-
.define(*_args, **_options) ⇒ void
Entry point for the Realtime DSL.
Class Method Details
.define(*_args, **_options) ⇒ void
This method returns an undefined value.
Entry point for the Realtime DSL.
47 48 49 |
# File 'lib/magik/realtime.rb', line 47 def self.define(*_args, **) raise NotImplementedError, "Magik::Realtime is spec-only; see docs/idea/00-build-spec.md" end |