Skip to content

Universal

Task executors are used to execute tasks in parallel or sequentially.

amsdal_glue.executors.SequentialSyncExecutor

Bases: SequentialExecutor

SequentialSyncExecutor is responsible for executing tasks sequentially.

execute_sequential

execute_sequential(
    tasks, final_task, transaction_id, lock_id
)

Executes the given list of tasks sequentially.

Parameters:

Name Type Description Default
tasks list[Task]

The list of tasks to be executed sequentially.

required
final_task Task | None

The final task to be executed after all tasks.

required
transaction_id str | None

The transaction ID to be used during execution.

required
lock_id str | None

The lock ID to be used during execution.

required

Returns:

Name Type Description
Any Any

The result of the final task execution.

amsdal_glue.executors.ThreadParallelExecutor

Bases: ParallelExecutor

ThreadParallelExecutor is responsible for executing tasks in parallel using threads.

execute_parallel

execute_parallel(tasks, transaction_id, lock_id)

Executes the given list of tasks in parallel using threads.

Parameters:

Name Type Description Default
tasks list[Task]

The list of tasks to be executed in parallel.

required
transaction_id str | None

The transaction ID to be used during execution.

required
lock_id str | None

The lock ID to be used during execution.

required

map_fn

map_fn(task, transaction_id, lock_id)

Maps and executes a single task, handling different task types.

Parameters:

Name Type Description Default
task Task

The task to be executed.

required
transaction_id str | None

The transaction ID to be used during execution.

required
lock_id str | None

The lock ID to be used during execution.

required