holoscan::DistributedAppService
holoscan::DistributedAppService
holoscan::DistributedAppService
Composite service interface for distributed fragment services.
DistributedAppService combines the FragmentService interface with distributed endpoint capabilities, allowing a single service implementation to:
This composite interface is particularly useful for services that need to synchronize state or coordinate operations across multiple fragments in a distributed Holoscan application. When registered with the application using register_service(), the framework automatically calls the appropriate driver/worker methods based on each fragment’s role.
In single-fragment applications, only the FragmentService interface is used. The distributed endpoint methods are only called in multi-fragment distributed applications.
Inherits from: holoscan::FragmentService (public), holoscan::distributed::ServiceDriverEndpoint (public), holoscan::distributed::ServiceWorkerEndpoint (public)
Inherit constructors from base classes.
This using declaration enables construction of DistributedAppService using the constructors of FragmentService, ServiceDriverEndpoint, and ServiceWorkerEndpoint, providing flexibility in how derived classes can be initialized.
Set the underlying resource managed by this service.
Parameters
Shared pointer to the resource to be managed.
Start the driver endpoint for distributed coordination.
This method is called by the framework on the driver fragment when the distributed application starts. Implementations should initialize any necessary resources for coordinating with worker fragments.
Parameters
The IP address of the driver fragment.
Shutdown the driver endpoint.
This method is called by the framework when the distributed application is shutting down. Implementations should clean up resources and notify any connected workers of the shutdown.
Connect the worker endpoint to the driver.
This method is called by the framework on worker fragments to establish a connection with the driver fragment. Implementations should connect to the driver and prepare to participate in distributed operations.
Parameters
The IP address of the driver fragment to connect to.
Disconnect the worker endpoint from the driver.
This method is called by the framework when the worker needs to disconnect from the driver. Implementations should clean up the connection and any associated resources.