Raxol.Terminal.Sync.Manager (Raxol v2.0.1)

View Source

Manages synchronization between different terminal components (splits, windows, tabs). Provides a high-level interface for component synchronization and state management.

Summary

Types

component_id()

@type component_id() :: String.t()

component_type()

@type component_type() :: :split | :window | :tab

sync_state()

@type sync_state() :: %{
  component_id: component_id(),
  component_type: component_type(),
  state: term(),
  metadata: %{
    version: non_neg_integer(),
    timestamp: non_neg_integer(),
    source: String.t()
  }
}

t()

@type t() :: %Raxol.Terminal.Sync.Manager{
  components: %{required(String.t()) => Raxol.Terminal.Sync.Component.t()},
  sync_id: String.t()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

do_sync_state(state, component_id, component_type, new_state, opts, existing_component)

generate_sync_id(state)

get_component_stats(component_id)

get_state(component_id)

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

register_component(component_id, component_type, initial_state \\ %{})

Starts the sync manager.

start_link(init_opts \\ [])

sync_state(component_id, new_state)

@spec sync_state(String.t(), term()) :: :ok

Syncs a component's state with default options.

sync_state(component_id, component_type, new_state, opts \\ [])

@spec sync_state(String.t(), String.t(), term(), keyword()) :: :ok

Syncs a component's state.

unregister_component(component_id)