Repository navigation
Updating docs for new ControlClient APIs - #796
MaciejKaszynski wants to merge 5 commits into
Conversation
bfb84ee to
f26c016
Compare
| } | ||
|
|
||
| // activate a different run target | ||
| const auto result = client->activate_run_target(score::mw::lifecycle::RunTargetName{"Running"}, true); |
There was a problem hiding this comment.
I guess a problem with this scenario is that it will always go into the race condition of possibly aborting the initial transition that started state manager in the first place.
I think this can probably not be avoided as long as we only have the "force" activation.
There was a problem hiding this comment.
I wonder if it would be enough if we do literal include of the specific sections from the existing control daemon example for depicting the API interaction.
There was a problem hiding this comment.
The examples/control_application/control_daemon.cpp has the same issue as I don't think there is any syncing between the callback and the main thread. I didn't use the control_daemon.cpp because of the custom IPC that is there which I don't think should be in the exmaple.
There was a problem hiding this comment.
I think the control_daemon.cpp happens to avoid this race condition because it does not directly initiate a transition after reporting kRunning, but only upon request via IPC.
I was wondering if it makes sense to reuse the examples we already have and only include certain parts into the documentation for explanation. From the sphinx docs it seemed possible like this:
// start-activate-doc
const auto result = client->activate_run_target(score::mw::lifecycle::RunTargetName{runTargetName}, true);
if (result.has_value())
{
std::cerr << "Successfully requested Run Target " << runTargetName << std::endl;
}
else
{
std::cerr << "Requesting Run Target " << runTargetName
<< " failed with error: " << result.error().Message() << std::endl;
}
// end-activate-docAnd then in the documentation include only the parts between the comment markers
.. literalinclude:: examples/control_application/control_daemon.cpp
:start-after: start-activate-doc
:end-before: end-activate-docBenefit would be:
- single set of examples in the repo, no duplication
- examples are built and also executed, so we are sure they are working
There was a problem hiding this comment.
But I also see a benefit of having these skeleton examples, so feel free to decide.
There was a problem hiding this comment.
But then we'd have to copy the /examples source code into the docs folder. Docs can't see anything outside the source_dir so we'd have to copy and the actual code wouldn't run and we could get out of sync.
There was a problem hiding this comment.
I fixed with atomics now
|
|
||
| For more information about the ``mw::com`` configuraiton please refer | ||
| to their documentation and tutorial at documentaiton | ||
| https://eclipse-score.github.io/communication/v0.5.0/score/mw/com/doc/tutorial/chapter_2/README.html#separate-configuration-files-for-provider-and-consumer |
There was a problem hiding this comment.
Can we use a link to latest version?
Otherwise we will need to keep updating the link every time.
There was a problem hiding this comment.
yeah wasn't really sure what to do because if we do latest there is a chance they will move pages and the link will not be valid.
would you say having latest is better?
There was a problem hiding this comment.
Not sure. But I am pretty sure we forget to align this link every release 😅
@TimoSteuerwaldETAS has some experience with automatic link checking for documentation, may we can roll this out in the repo?
There was a problem hiding this comment.
I have added the link checker here: https://github.com/etas-eng/vsps_lifecycle_docs/blob/main/build_docs.sh
There it is executed now during each build. Andreas recommended to execute it once per week, but for the internal repo, as there is not much traffic anyways, I think it is fine to keep it as it is.
For the public repo I would first give it a try and check how much it increases build time. Depending on that we can set the frequency for this check.
|
Documentation preview for this pull request is available at: |
713b5b0 to
a33cffb
Compare
| interface. | ||
| The **State Manager** is itself a managed component. | ||
| Before calling ``activate_run_target``, it must report the Running state to the | ||
| Launch Manager via the **Lifecycle API**. |
There was a problem hiding this comment.
I wonder if it is clear to the user what we refer to with "Lifecycle API" and "Lifecycle Interface".
Maybe we should clarify somewhere that this term refers to 3 APIs:
The C++ report_running function, the rust report_running function and this run_application stuff
There was a problem hiding this comment.
I think it's clear now, since it can use any of them.
|
Few small comments, but generally looks good to me. |
Updating docs for new ControlClient APIs