# `Immich.Sync`

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.

# `run_opts`

```elixir
@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.

# `run`

```elixir
@spec run(
  Immich.API.Session.t(),
  [String.t()],
  Immich.Sync.EventStream.t(),
  Immich.Sync.EventProcessor.t(),
  run_opts()
) :: {:ok, %{required(String.t()) =&gt; 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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
