adamdebreceni commented on code in PR #2292:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2292#discussion_r4480606940
##########
minifi_main/MiNiFiMain.cpp:
##########
@@ -289,19 +325,18 @@ int main(int argc, char **argv) {
process_running.test_and_set();
- std::atomic<bool> restart_token{false};
- const auto request_restart = [&] {
- if (!restart_token.exchange(true)) {
- // only trigger if a restart is not already in progress (the flag was
unset before the exchange)
- flow_controller_running.clear();
- flow_controller_running.notify_all();
+ const auto request_shutdown = [&] (minifi::ShutdownType shutdown_type,
std::optional<int32_t> shutdown_exit_code) {
Review Comment:
while I love a good std::function, in this case I would go for a
```
class AgentController {
public:
void requestShutdown(std::optional<int32_t> exit_code);
void requestRestart();
};
```
`shutdown_exit_code` being used only when `shutdown_type ==
ShutdownType::SHUTDOWN` hints at this, also having shutdown both mean shutdown
and restart is pretty confusing imo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]