Raxol.Terminal.Sync.SyncServer (Raxol v2.0.1)
View SourceUnified synchronization system for the Raxol terminal emulator. This module provides centralized synchronization mechanisms for:
- State synchronization between windows
- Event synchronization
- Resource synchronization
Summary
Functions
Returns a specification to start this module under a supervisor.
Cleans up a synchronization context.
Creates a new synchronization context.
Gets the current state of a synchronization context.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Resolves conflicts between synchronized data.
Synchronizes data between windows.
Types
@type sync_config() :: %{ consistency: :strong | :eventual, conflict_resolution: :last_write_wins | :version_based | :custom, timeout: non_neg_integer(), retry_count: non_neg_integer() }
@type sync_id() :: term()
@type sync_state() :: %{ id: sync_id(), type: :state | :event | :resource, data: term(), version: non_neg_integer(), timestamp: integer(), metadata: map() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Cleans up a synchronization context.
Parameters
sync_id- The synchronization context ID
Creates a new synchronization context.
Parameters
type- Type of synchronization (:state, :event, or :resource)opts- Creation options:consistency- Consistency level:conflict_resolution- Conflict resolution strategy:timeout- Synchronization timeout:retry_count- Number of retry attempts
Gets the current state of a synchronization context.
Parameters
sync_id- The synchronization context ID
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Resolves conflicts between synchronized data.
Parameters
sync_id- The synchronization context IDconflicts- List of conflicting versionsopts- Resolution options:strategy- Override the default conflict resolution strategy
Synchronizes data between windows.
Parameters
sync_id- The synchronization context IDdata- The data to synchronizeopts- Synchronization options:version- Current version of the data:metadata- Additional metadata