First version of new API for Launch Manager - #377
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
|
It looks like it could work. To see if this if this is the right fit in combination with |
|
|
||
| /// @brief Activation happened automatically as part of a recovery action, | ||
| /// without an explicit State Manager request. | ||
| kRecoveryAction = 1 |
There was a problem hiding this comment.
I think we should add reason
There was a problem hiding this comment.
I assume this will mean we need to adapt ActivationCallback then.
https://github.com/eclipse-score/lifecycle/pull/377/changes#diff-0112cf4be18e494bec2720f425278091273c52be4ffbe12f527cd85178077895R66-R67
Do you have something in mind?
I like this suggestion. Would it be possible to add a dummy details/lm_controlimpl.hpp with a test that just shows how the API interaction would look like from the users perspective? |
| /// @error kRunTargetDoesntExist Name of the requested Run Target does not exist in current configuration. | ||
| /// @error kCommunicationError Connection with Launch Manager cannot be established and request cannot be | ||
| /// sent. | ||
| virtual score::Result<void> activate_run_target(std::string_view runTargetName, bool force = false) = 0; |
There was a problem hiding this comment.
should this not be RunTargetName
There was a problem hiding this comment.
@NicolasFussberger do you remember why we went with std::string_view here?
I have feeling that RunTargetName maybe better here... As this is what probably will travel through mw::com
There was a problem hiding this comment.
For consistency, RunTargetName is probably better.
Depending on how the data is represented in the mw::com interface it may then require an additional copy though.
There was a problem hiding this comment.
I would not expos here any mw::com internals and go with RunTargetName
| /// @error kCallbackInProgress A new callback cannot be registered because the | ||
| /// current callback is still executing. Retry after it returns. | ||
| /// @error kInvalidArguments The callback is empty. | ||
| virtual score::Result<void> register_run_target_activation_callback(ActivationCallback callback) = 0; |
There was a problem hiding this comment.
AFAIK within the context of the callback, you may not call other mw::methods / send events.
If this is true, it is not easily supported to trigger the next run target activation after the previous one finished (in the scope of the callback). User would need to store the information provided by the callback and then pick this up from a different thread.
@eduard-moskalchuk do you have some insights if this is true?
There was a problem hiding this comment.
There was some limitations for sure with calling methods from methods callbacks. But it's our work in LM to address this issue and make the interface functional and not expose some communication channel limitations to the user.
pawelrutkaq
left a comment
There was a problem hiding this comment.
I would fix most of descriptions as they are bloated
|
|
||
| /// @brief Factory method — create a connected ILmControl instance. | ||
| /// | ||
| /// Establishes the mw::com connection to the Launch Manager. |
There was a problem hiding this comment.
I'd say interface shall be silent about internals (in this case mw::com)
|
|
||
| // Non-copyable and non-movable. Polymorphic types must not be copied or | ||
| // moved through the interface — it would slice the concrete implementation. | ||
| // Transfer ownership via std::unique_ptr<ILmControl> instead. |
| /// notified asynchronously via the callback registered with | ||
| /// register_run_target_activation_callback(). | ||
| /// If the queue is full, kRequestQueueIsFull is returned immediately | ||
| /// and the request is discarded. |
| /// @error kRunTargetDoesntExist Name of the requested Run Target does not exist in current configuration. | ||
| /// @error kCommunicationError Connection with Launch Manager cannot be established and request cannot be | ||
| /// sent. | ||
| virtual score::Result<void> activate_run_target(std::string_view runTargetName, bool force = false) = 0; |
There was a problem hiding this comment.
I would not expos here any mw::com internals and go with RunTargetName
| /// @error kCallbackInProgress A new callback cannot be registered because the | ||
| /// current callback is still executing. Retry after it returns. | ||
| /// @error kInvalidArguments The callback is empty. | ||
| virtual score::Result<void> register_run_target_activation_callback(ActivationCallback callback) = 0; |
There was a problem hiding this comment.
There was some limitations for sure with calling methods from methods callbacks. But it's our work in LM to address this issue and make the interface functional and not expose some communication channel limitations to the user.
First draft of new API for Launch Manager