Start an asynchronous FindService
notification about service updates.

Note: The callback handler might execute before this function returns. Therefore, do not call StopFindService() within the callback, as it requires the FindServiceHandle
returned by this function.
There are two ways the function can find service instances:
- from the
InstanceIdentifier
- from the
InstanceSpecifier
Syntax
//Find service from InstanceIdentifier
FindServiceHandle ServiceInterfaceProxy::StartFindService(FindServiceHandler<HandleType> handler, InstanceIdentifier instance)
//Find service from InstanceSpecifier
FindServiceHandle ServiceInterfaceProxy::StartFindService(FindServiceHandler<HandleType> handler, InstanceSpecifier instance)
Parameters
in |
| Gets called upon detection of a matching service. This parameter cannot be |
in |
|
|
Returns
FindServiceHandle
The Handle is needed to stop the service availability monitoring and related firing of the given handler.

Note: The handles received by this callback shall be released before the runtime is destroyed. They cannot be stored in variables with longer life period than the application's main()
.
If not followed, it's not guaranteed that the communication middleware is shut down properly and may lead to segmentation fault.
Any exception thrown by the callback will lead to a termination through std::terminate()
.
Precondition
- The
InstanceSpecifier
(instance)
orInstanceIdentifier (instance)
must be configured.
Thread-safety, Reentrance, Result Delivery
- Threadsafe : FALSE.
- Reentrant : FALSE.
- Synchronous : FALSE.
Example
class RPortExampleServiceConsumer final {
public:
using TyServiceProxy = services::exampleservice::proxy::ExampleServiceProxy;
…
}
void RPortExampleServiceConsumer::StartServiceConsumer(ara::core::InstanceSpecifier example_instance_spec) noexcept {
opt_find_service_handle_ = TyServiceProxy::StartFindService(
[this](ara::com::ServiceHandleContainer<TyServiceProxy::HandleType> service_handle_container) {
…
}, example_instance_spec);
}