Skip to main content

execute_streaming

Function execute_streaming 

Source
pub fn execute_streaming<U, V>(
    plan: &ImportActionPlan,
    workspace: &mut Workspace,
    opts: StreamingOptions<'_, U, V>,
    on_event: impl Fn(StreamingEvent),
) -> Result<StreamingReport, StreamingError>
Expand description

Drive a streaming import: the bounded per-asset import → upload → verify → release window over plan, under opts.

The enrichment in StreamingOptions::source is written inside the signed sidecar, at the same single write path the bulk executor drives, so the drive mode a user picks never changes what a migrated library keeps: a storage-constrained device streaming a Takeout export lands the exporter’s capture time, GPS, caption, favorite, and album membership exactly as an unconstrained one does. This is the streaming twin of execute_with_source_metadata.

Returns a StreamingReport; a hard failure to start (insufficient headroom, a failed probe) is a StreamingError. Per-asset upload pauses and gate retentions are outcomes, not errors: on a pause the window halts (report.halted set) with no further files admitted, and the run can be re-invoked after reconnect — the deterministic planner re-derives the remaining work and skips already-completed assets.