MishkaCmsCore.Activity.Sources.RuntimeCompile (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Activity source for on-demand (lazy) runtime module compiles.

A lazy runtime part (precompile: false, e.g. a Page) is compiled inside the visitor's web request on first hit — there is no Oban job, so neither the runtime status panel nor the activity feed would otherwise hear about it. The compiler emits a lightweight telemetry event ([:mishka_cms, :runtime, :compiler, :compiled]) — fire-and-forget, no blocking, no side effects in the compile path — and this source bridges it to PubSub, exactly like MishkaCmsCore.Activity.Sources.Oban bridges Oban job telemetry.

Attached once on boot via attach/0 (from MishkaCmsCore.Application.start/2).

Topics

  • runtime_compiled:res:<resource> — compiles of one resource (any site)
  • runtime_compiled:site:<id>:res:<resource> — one resource on one site

No initial_fetch/2 history: lazy compiles are ephemeral (not persisted), so the feed shows them live but they do not appear in the historical activity log.

Summary

Functions

Attach the compiler telemetry → PubSub bridge. Idempotent.

Functions

attach()

Attach the compiler telemetry → PubSub bridge. Idempotent.