eclipse-score / eclipse-score/lifecycle

Possible API extension: Waiting for successful connection

Open
#512 0 comments 0 reactions 0 assignees View on GitHub
com
Dominant language
C++
Stars
6
Forks
34
Avg merge
2d 3h
Merged PRs (30d)
80

Description

### What

In case mw::com is used with a network binding, the connection between StateManager and LaunchManager may not be established immediately. It will take time to do the service discovery.
Currently, there is no clear way to wait until the connection is established other than doing e.g. Polling of ``´get_active_run_target()` until it no longer reports `kCommunicationError`.

A nicer way would be to introduce something like `wait_until_connected(timeout)` or `is_connected()` for this purpose.

Example:
```cpp
auto result = ILmControl::Create("my/instance");
// check for error...
// ..
auto lmcontrol = std::move(result.value());
auto result = lmcontrol->wait_until_connected(100ms);
if(result) {
// connection is established.
// calls may still fail if connection goes away (mostly relevant with network binding)
}
```

See also: https://github.com/eclipse-score/lifecycle/pull/478#discussion_r3828461201

### Acceptance Criteria (DoD)

* Decide on the extension

### How

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.