> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# task_handler

## ThreadPoolTaskHandler

A task handler that manages dependencies and executes tasks in a thread pool.

### all\_tasks\_completed

```python theme={null}
def all_tasks_completed(self) -> bool
```

Check if all tasks are completed.

**Returns**

* `bool`: True if all tasks are completed, False otherwise.

### get\_children

```python theme={null}
def get_children(self, parent_task_id: str) -> list[dict]
```

Get the children of a task.

### get\_result

```python theme={null}
def get_result(self, task_id: str) -> Any
```

Get result if task completed, otherwise raises exception.

### get\_retry\_count

```python theme={null}
def get_retry_count(self, task_id: str) -> int
```

Get the retry count for a task.

### get\_status

```python theme={null}
def get_status(self, task_id: str) -> TaskStatus
```

Returns the status of a task.

**Arguments**

* `task_id` (`str`): The ID of the task.

**Returns**

* `TaskStatus`: The status of the task.

### increment\_retry

```python theme={null}
def increment_retry(self, task_id: str) -> None
```

Increment the retry count for a task.

**Arguments**

* `task_id` (`str`): The ID of the task.

### submit\_task

```python theme={null}
def submit_task(self,
                task_id: str,
                async_fn: Union[Callable[[], Awaitable[Any]], Coroutine],
                dependent_on_prev: bool=False) -> None
```

Submit a task to the thread pool.

**Arguments**

* `task_id` (`str`): The ID of the task.
* `async_fn` (`Union[Callable[[], Awaitable[Any]], Coroutine]`): The async function to submit to the thread pool.
* `dependent_on_prev` (`bool`): Whether the task depends on the previous task.

### submit\_task\_with\_parent

```python theme={null}
def submit_task_with_parent(self,
                            task_id: str,
                            async_fn: Union[Callable[[], Awaitable[Any]], Coroutine],
                            parent_task_id: str) -> None
```

Submit a task that depends on a specific parent task.

**Arguments**

* `task_id` (`str`): The ID of the task.
* `async_fn` (`Union[Callable[[], Awaitable[Any]], Coroutine]`): The async function to submit to the thread pool.
* `parent_task_id` (`str`): The ID of the parent task this depends on.
