Raxol.Core.Runtime.ProcessComponent (Raxol v2.6.0)

View Source

A GenServer wrapping a single component module for crash isolation.

Each ProcessComponent runs in its own process under Raxol.DynamicSupervisor, so a crash in one component does not bring down the rest of the application. On crash, the DynamicSupervisor restarts the component with fresh state.

Usage

Components used with ProcessComponent must implement:

  • init/1 - receives props, returns initial state
  • render/2 - receives state and context, returns element tree
  • update/2 (optional) - receives message and state, returns new state

Use the process_component/2 View DSL helper to embed process components:

process_component(MyHeavyWidget, %{path: "/tmp"})

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_render_tree(pid, context)

send_update(pid, message)

start_link(opts)