Skip to content

Latest commit

 

History

History
187 lines (95 loc) · 3.89 KB

File metadata and controls

187 lines (95 loc) · 3.89 KB

downflux


downflux / TaskCoordinator

Class: TaskCoordinator

Defined in: packages/core/coordinators/TaskCoordinator.ts:16

Coordinates concurrent work within an execution result.

Remarks

The task coordinator owns concurrency, hooks, progress updates, and output mode behavior. It keeps download scheduling separate from provider methods and from the lower-level transfer code that writes individual items.

Constructors

Constructor

new TaskCoordinator(transferCoordinator, fileManager, transformerRegistry, progressManager, pipelineRegistry): TaskCoordinator

Defined in: packages/core/coordinators/TaskCoordinator.ts:19

Parameters

transferCoordinator

TransferCoordinator

fileManager

FileManager

transformerRegistry

TransformerRegistry

progressManager

ProgressManager

pipelineRegistry

PipelineRegistry

Returns

TaskCoordinator

Methods

runWithConcurrency()

runWithConcurrency<T>(items, concurrency, worker): Promise<void>

Defined in: packages/core/coordinators/TaskCoordinator.ts:142

Runs asynchronous workers with a bounded concurrency limit.

Type Parameters

T

T

Parameters

items

T[]

Items to process.

concurrency

number

Maximum number of active workers.

worker

(item, index) => Promise<void>

Async item handler.

Returns

Promise<void>


handleJsonOutput()

handleJsonOutput<T, S>(result, options): Promise<ExecutionResult<T, S>>

Defined in: packages/core/coordinators/TaskCoordinator.ts:166

Persists a JSON execution result.

Type Parameters

T

T

S

S extends ExecutionShape

Parameters

result

ExecutionResult<T, S>

Execution result to serialize.

options

ExecutionOptions

Output options containing directory configuration.

Returns

Promise<ExecutionResult<T, S>>

The original execution result.


handleDeviceOutputAsync()

handleDeviceOutputAsync<T, S>(options, outputType, request, pipelineHooks, result): void

Defined in: packages/core/coordinators/TaskCoordinator.ts:183

Starts background download processing for device or buffer output.

Type Parameters

T

T

S

S extends ExecutionShape

Parameters

options

ExecutionOptions

Execution options.

outputType

OutputType

Output mode.

request

ExecutionArgs

Original execution request.

pipelineHooks

PipelineHook[]

Hooks fired around extraction/download events.

result

ExecutionResult<T, S>

Execution result to update while downloads progress.

Returns

void