Keep service around until client exits (#48)
* Keep service around until client exits * use ignore_signal return handler
This commit is contained in:
parent
2c9320f5b0
commit
2811eb1312
2 changed files with 7 additions and 2 deletions
|
@ -113,8 +113,6 @@ int main(int argc, char ** argv)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
|
||||||
|
|
||||||
// Initialize a response.
|
// Initialize a response.
|
||||||
example_interfaces__srv__AddTwoInts_Response service_response;
|
example_interfaces__srv__AddTwoInts_Response service_response;
|
||||||
example_interfaces__srv__AddTwoInts_Response__init(&service_response);
|
example_interfaces__srv__AddTwoInts_Response__init(&service_response);
|
||||||
|
@ -149,6 +147,10 @@ int main(int argc, char ** argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Our scope exits should take care of fini for everything
|
// Our scope exits should take care of fini for everything
|
||||||
|
// stick around until launch gives us a signal to exit
|
||||||
|
while (true) {
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return main_ret;
|
return main_ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# generated from rcl/test/test_two_executables.py.in
|
# generated from rcl/test/test_two_executables.py.in
|
||||||
|
|
||||||
from launch import LaunchDescriptor
|
from launch import LaunchDescriptor
|
||||||
|
from launch.exit_handler import ignore_signal_exit_handler
|
||||||
from launch.exit_handler import primary_exit_handler
|
from launch.exit_handler import primary_exit_handler
|
||||||
from launch.launcher import DefaultLauncher
|
from launch.launcher import DefaultLauncher
|
||||||
|
|
||||||
|
@ -11,11 +12,13 @@ def @TEST_NAME@():
|
||||||
ld.add_process(
|
ld.add_process(
|
||||||
cmd=['@TEST_EXECUTABLE1@'],
|
cmd=['@TEST_EXECUTABLE1@'],
|
||||||
name='@TEST_EXECUTABLE1_NAME@',
|
name='@TEST_EXECUTABLE1_NAME@',
|
||||||
|
exit_handler=ignore_signal_exit_handler,
|
||||||
)
|
)
|
||||||
|
|
||||||
ld.add_process(
|
ld.add_process(
|
||||||
cmd=['@TEST_EXECUTABLE2@', '@TEST_EXECUTABLE1_NAME@'],
|
cmd=['@TEST_EXECUTABLE2@', '@TEST_EXECUTABLE1_NAME@'],
|
||||||
name='@TEST_EXECUTABLE2_NAME@',
|
name='@TEST_EXECUTABLE2_NAME@',
|
||||||
|
exit_handler=primary_exit_handler,
|
||||||
)
|
)
|
||||||
|
|
||||||
launcher = DefaultLauncher()
|
launcher = DefaultLauncher()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue