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.

See Also:

Constant Summary collapse

SPEC_PHASE =

The build-spec phase this subsystem implements.

Returns:

  • (String)
"Phase 3 — Realtime (opt-in)"
DSL_SURFACE =

The DSL this subsystem will expose, verbatim from the spec.

Returns:

  • (Array<String>)
[
  "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.

Returns:

  • (String)
"Not implemented — spec only"

Class Method Summary collapse

Class Method Details

.define(*_args, **_options) ⇒ void

This method returns an undefined value.

Entry point for the Realtime DSL.

Parameters:

  • _args (Array)

    ignored

  • _options (Hash)

    ignored

Raises:

  • (NotImplementedError)

    always, until Phase 3 lands



47
48
49
# File 'lib/magik/realtime.rb', line 47

def self.define(*_args, **_options)
  raise NotImplementedError, "Magik::Realtime is spec-only; see docs/idea/00-build-spec.md"
end