Raxol.Terminal.Sync.UnifiedSync (Raxol v0.5.0)
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.
Resolves conflicts between synchronized data.
Starts the unified synchronization manager.
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
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
Starts the unified synchronization manager.
Options
:consistency
- Default consistency level (:strong or :eventual):conflict_resolution
- Default conflict resolution strategy:timeout
- Default synchronization timeout in milliseconds:retry_count
- Default number of retry attempts
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