holoscan::AppWorker

Beta
View as Markdown
#include <holoscan/app_worker.hpp>

Constructors

AppWorker

holoscan::AppWorker::AppWorker(holoscan::AppWorker::AppWorker(
Application *app
)

Destructor

~AppWorker

virtual holoscan::AppWorker::~AppWorker()virtual holoscan::AppWorker::~AppWorker()

Methods

options

CLIOptions * holoscan::AppWorker::options()CLIOptions * holoscan::AppWorker::options()

target_fragments

std::vector<FragmentNodeType> & holoscan::AppWorker::target_fragments()

fragment_graph

FragmentFlowGraph & holoscan::AppWorker::fragment_graph()

server

distributed::AppWorkerServer * holoscan::AppWorker::server(distributed::AppWorkerServer * holoscan::AppWorker::server(
std::unique_ptr<distributed::AppWorkerServer> &&server
)

execute_fragments

bool holoscan::AppWorker::execute_fragments(
std::unordered_map<std::string, std::vector<std::shared_ptr<holoscan::ConnectionItem>>> &name_connection_list_map
)

terminate_scheduled_fragments

bool holoscan::AppWorker::terminate_scheduled_fragments()

submit_message

void holoscan::AppWorker::submit_message(
WorkerMessage &&message
)

process_message_queue

void holoscan::AppWorker::process_message_queue()

app_driver_client

std::shared_ptr<distributed::AppDriverClient> holoscan::AppWorker::app_driver_client() const

worker_shutdown_timeout_ms

int64_t holoscan::AppWorker::worker_shutdown_timeout_ms() const

Get the calculated worker shutdown timeout in milliseconds.

This timeout is dynamically calculated based on the number of fragments and their scheduler’s stop_on_deadlock_timeout values.

Returns: The shutdown timeout in milliseconds.

handle_worker_connect

void holoscan::AppWorker::handle_worker_connect(
const std::string_view &driver_ip
) noexcept

Start the fragment services.

handle_worker_disconnect

void holoscan::AppWorker::handle_worker_disconnect() noexcept

Terminate the fragment services.

setup_signal_handlers

void holoscan::AppWorker::setup_signal_handlers()

get_target_fragments

std::vector<FragmentNodeType> holoscan::AppWorker::get_target_fragments(
FragmentFlowGraph &fragment_graph
)

Get target fragments from the options.


Types

WorkerMessageCode

NameValueDescription
kExecuteFragments
kNotifyWorkerExecutionFinished
kTerminateWorker

Member variables

NameTypeDescription
app_Application *The application to run.
options_CLIOptions *The command line options.
worker_server_std::unique_ptr< distributed::AppWorkerServer >
fragment_graph_FragmentFlowGraph *
target_fragments_std::vector< FragmentNodeType >
scheduled_fragments_std::vector< FragmentNodeType >
need_notify_execution_finished_std::atomic< bool >Atomic flag for thread-safe access.
termination_code_AppWorkerTerminationCode
worker_shutdown_timeout_ms_int64_tCalculated shutdown watchdog timeout (ms).
shutdown_complete_std::shared_ptr< std::atomic< bool > >Flag to cancel watchdog on clean exit.
fragment_futures_std::unordered_map< std::string, std::shared_future< void > >Map of fragment names to their execution futures (for checking individual completion).
message_mutex_std::mutexMutex for the message queue.
message_queue_std::queue< WorkerMessage >Queue of messages to be processed.

Inner classes

WorkerMessage

struct holoscan::AppWorker::WorkerMessage
NameTypeDescription
codeWorkerMessageCode
datastd::any