StatifierUI.Kino (StatifierUI v0.1.0)

Copy Markdown View Source

The Livebook inspector: inspect/3 composes the four panes - configuration diagram, datamodel explorer, event injection, event log - over one shared StatifierUI.Trace.Subscriber, attached with catch-up (statifier ADR-0049), inside one Kino.Layout.

Compiled only when the optional :kino dependency is present (ADR-0004); a host without it gets a stub whose inspect/3 raises with instructions. Nothing else in this package touches Kino.

Lifecycle

Every process this module starts - the subscriber and the updater - goes through Kino.start_child/1, so re-evaluating the cell terminates them with it. The session notices the dead subscriber through its own monitor and drops it from its subscriber set: that is the clean detach, with nothing to unsubscribe by hand. The session itself is not owned here - it keeps running across cell re-evaluations, which is exactly what makes catch-up worth having.

Catch-up needs record: true

Start the session with record: true (and trace: true) for the inspector to reconstruct everything it missed. Without it the subscriber falls back to live delivery and the status header labels the panes Live-only - a partial stream is never presented as whole. Replay cost grows with run length (it re-runs the recording in the attaching process), so expect cell evaluation on a very long-lived session to take correspondingly longer.

Summary

Functions

Builds the inspector for session and returns the composed Kino.Layout for the cell to render.

Functions

inspect(session, fixtures \\ nil, opts \\ [])

@spec inspect(pid(), StatifierUI.Fixtures.t() | nil, keyword()) :: Kino.Layout.t()

Builds the inspector for session and returns the composed Kino.Layout for the cell to render.

fixtures is a StatifierUI.Fixtures.t/0 (or nil): it feeds the injection palette's per-event buttons. opts:

  • :source - the SCXML text, forwarded to the subscriber for the session.start manifest.
  • :capacity - the subscriber's buffer capacity (default 1000).