Skip to main content

import_tasks_concurrent

Function import_tasks_concurrent 

Source
async fn import_tasks_concurrent<E>(
    config: &ImportResumeConfig,
    state: &mut ImportState,
    executor: &E,
    task_parallelism: usize,
    progress: &dyn ProgressReporter,
) -> Result<()>
Expand description

Imports up to task_parallelism data tasks concurrently on the client.

The coordinator owns all state mutation/persistence: it marks tasks InProgress and persists the state before polling their futures, then applies each task result and persists again on completion. The task futures only run the import; they never touch the state, so state writes stay serialized in this task.

On the first task failure we stop scheduling new tasks but let already in-flight tasks finish and persist their final status, then return the first error.