[cdc_stream] Implement stop-service command (#29)

Implements cdc_stream stop-service. Also fixes an issue in the
BackgroundService implementation where Exit() would deadlock since
server shutdown waits for all RPCs to exit.
This commit is contained in:
Lutz Justen
2022-12-02 19:39:13 +01:00
committed by GitHub
parent 1120dcbee0
commit 90717ce670
8 changed files with 149 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
#include "cdc_stream/start_command.h"
#include "cdc_stream/start_service_command.h"
#include "cdc_stream/stop_command.h"
#include "cdc_stream/stop_service_command.h"
#include "lyra/lyra.hpp"
int main(int argc, char* argv[]) {
@@ -33,6 +34,9 @@ int main(int argc, char* argv[]) {
cdc_ft::StartServiceCommand start_service_cmd(&exit_code);
start_service_cmd.Register(cli);
cdc_ft::StopServiceCommand stop_service_cmd(&exit_code);
stop_service_cmd.Register(cli);
// Parse args and run. Note that parse actually runs the commands.
// exit_code is -1 if no command was run.
auto result = cli.parse({argc, argv});