> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::distributed::AppWorkerServer

```cpp showLineNumbers={false}
#include <holoscan/distributed/server.hpp>
```

---

## Constructors

### AppWorkerServer \[#appworkerserver]

```cpp showLineNumbers={false}
holoscan::distributed::AppWorkerServer::AppWorkerServer(
    holoscan::AppWorker *app_worker,
    bool need_health_check = false
)
```

### Destructor \[#destructor]

### \~AppWorkerServer

```cpp showLineNumbers={false}
virtual holoscan::distributed::AppWorkerServer::~AppWorkerServer()
```

---

## Methods

### start \[#start]

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::start()
```

### stop \[#stop]

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::stop()
```

### wait \[#wait]

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::wait()
```

### notify \[#notify]

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::notify()
```

### connect\_to\_driver \[#connecttodriver]

```cpp showLineNumbers={false}
bool holoscan::distributed::AppWorkerServer::connect_to_driver(
    int32_t max_connection_retry_count = kDefaultMaxConnectionRetryCount,
    int32_t connection_retry_interval_ms = kDefaultConnectionRetryIntervalMs
)
```

### fragment\_executors\_future \[#fragmentexecutorsfuture]

#### Overload 1

```cpp showLineNumbers={false}
std::shared_future<void> & holoscan::distributed::AppWorkerServer::fragment_executors_future()
```

#### Overload 2

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::fragment_executors_future(
    std::future<void> &future
)
```

### notify\_worker\_execution\_finished \[#notifyworkerexecutionfinished]

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::notify_worker_execution_finished(
    holoscan::AppWorkerTerminationCode code
)
```

### app\_driver\_client \[#appdriverclient]

```cpp showLineNumbers={false}
std::shared_ptr<distributed::AppDriverClient> holoscan::distributed::AppWorkerServer::app_driver_client() const
```

### run \[#run]

```cpp showLineNumbers={false}
void holoscan::distributed::AppWorkerServer::run()
```

The thread function for the server thread.

---

## Member variables

| Name                         | Type                                 | Description                                                             |
| ---------------------------- | ------------------------------------ | ----------------------------------------------------------------------- |
| `server_`                    | `std::unique_ptr< grpc::Server >`    | Pointer to the gRPC server.                                             |
| `server_thread_`             | `std::unique_ptr< std::thread >`     | Pointer to the server thread.                                           |
| `cv_`                        | `std::condition_variable`            | [Condition](../../../classes/condition) variable for the server thread. |
| `mutex_`                     | `std::mutex`                         | Mutex for the server thread.                                            |
| `join_mutex_`                | `std::mutex`                         | Mutex for the join function.                                            |
| `should_stop_`               | `bool`                               | Whether the server should stop.                                         |
| `app_worker_`                | `holoscan::AppWorker *`              | Pointer to the application worker.                                      |
| `driver_client_`             | `std::shared_ptr< AppDriverClient >` |                                                                         |
| `need_health_check_`         | `bool`                               | Whether to check the health of the application.                         |
| `fragment_executors_future_` | `std::shared_future< void >`         | Future for the fragment executors.                                      |