Skip to main content

ScanOptions

@rotorsoft/act-root


@rotorsoft/act-root / act/src / ScanOptions

Type Alias: ScanOptions

ScanOptions = object

Defined in: libs/act/src/types/action.ts:559

Options for the orchestrator's restore scan loop, consumed by IAct.restore (and threaded through to the internal scan). Adapters never see these โ€” they're entirely interpreted on the orchestrator side.

Two more flags reserved for a future follow-up (drop_closed_streams, drop_empty_streams) need a pre-pass over the source โ€” they wait on the source-shape decision (re-iterable factory vs. buffer in memory).

Propertiesโ€‹

drop_snapshots?โ€‹

readonly optional drop_snapshots?: boolean

Defined in: libs/act/src/types/action.ts:568

Skip events with name === SNAP_EVENT. The next snap policy regenerates snapshots against current code; useful for backups that should compact stale snapshot bytes. Counted in ScanResult.dropped.snapshots.

Single-pass: no source-shape implications. Default false.


dry_run?โ€‹

readonly optional dry_run?: boolean

Defined in: libs/act/src/types/action.ts:597

When true, IAct.restore runs the scan loop without touching the store โ€” events are validated and counted but no transaction is opened and no rows are written. Returned kept / dropped reflect what a subsequent destructive restore against the same source would land; a throw means the source has a blocker (the running index pinpoints it).

No Store.restore capability is required for a dry-run โ€” the adapter is never called. Default false.


on_progress?โ€‹

readonly optional on_progress?: (p) => void

Defined in: libs/act/src/types/action.ts:584

Optional progress callback. The scan loop fires it once per event during iteration. The callback receives the running processed count; total is left undefined because the source is async-iterable and the orchestrator doesn't know its length up front.

Synchronous handler โ€” the scan loop calls it directly. Throttling / batching is the caller's responsibility: for a million-event restore, debounce in the handler rather than expecting the loop to coalesce calls. Keeping it unthrottled means callers that want every-event reporting get it without a config knob.

Parametersโ€‹

pโ€‹
processedโ€‹

number

total?โ€‹

number

Returnsโ€‹

void