Immich.Sync (ex_immich v0.1.1)

Copy Markdown

Callback-driven sync pipeline for streaming, processing, and acknowledgements.

This module does not persist events directly. It requests events from the configured event stream module, processes them chunk-by-chunk through an event processor module, and acknowledges processed chunks in the same order.

Summary

Types

Options passed through to sync and processing callbacks.

Types

run_opts()

@type run_opts() :: [
  batch_size: pos_integer(),
  event_stream_opts: Immich.Sync.EventStream.opts(),
  event_processor_opts: Immich.Sync.EventProcessor.opts()
]

Options passed through to sync and processing callbacks.

Functions

run(session, event_types, stream_handler_module, event_processor_module, opts \\ [])

@spec run(
  Immich.API.Session.t(),
  [String.t()],
  Immich.Sync.EventStream.t(),
  Immich.Sync.EventProcessor.t(),
  run_opts()
) :: {:ok, %{required(String.t()) => non_neg_integer()}} | {:error, term()}

Runs one sync processing session with separate modules.

Events are consumed from stream_handler_module.sync_stream/3, converted to %Immich.Sync.Event{}, batched, chunked by contiguous event type runs, then processed by event_processor_module.process_events/2 and acknowledged through stream_handler_module.sync_ack/3 per chunk in order.