aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Tommy Chen <toc007@ucsd.edu>2018-12-26 11:17:48 -0800
committerGravatar Tommy Chen <toc007@ucsd.edu>2018-12-26 11:17:48 -0800
commit39ac83a49ea73f619edbfd7ebde47f12d67a18f3 (patch)
tree9824b6a7d6860d51f93ed6b35bace4961b41ec09 /examples
parent102d5d88a626e29f1dccc4ffdb977d1bcd7a5937 (diff)
ruby-sigint ready to be merged!
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/ruby/greeter_server.rb5
-rwxr-xr-xexamples/ruby/route_guide/route_guide_server.rb5
2 files changed, 8 insertions, 2 deletions
diff --git a/examples/ruby/greeter_server.rb b/examples/ruby/greeter_server.rb
index dca61714b8..5290429742 100755
--- a/examples/ruby/greeter_server.rb
+++ b/examples/ruby/greeter_server.rb
@@ -39,7 +39,10 @@ def main
s = GRPC::RpcServer.new
s.add_http2_port('0.0.0.0:50051', :this_port_is_insecure)
s.handle(GreeterServer)
- s.run_till_terminated
+ # Runs the server with SIGHUP, SIGINT and SIGQUIT signal handlers to
+ # gracefully shutdown.
+ # User could also choose to run server via call to run_till_terminated
+ s.run_till_terminated_or_interrupted([1, 'int', 'SIGQUIT'])
end
main
diff --git a/examples/ruby/route_guide/route_guide_server.rb b/examples/ruby/route_guide/route_guide_server.rb
index 5eb268b533..ffcebd8418 100755
--- a/examples/ruby/route_guide/route_guide_server.rb
+++ b/examples/ruby/route_guide/route_guide_server.rb
@@ -172,7 +172,10 @@ def main
s.add_http2_port(port, :this_port_is_insecure)
GRPC.logger.info("... running insecurely on #{port}")
s.handle(ServerImpl.new(feature_db))
- s.run_till_terminated
+ # Runs the server with SIGHUP, SIGINT and SIGQUIT signal handlers to
+ # gracefully shutdown.
+ # User could also choose to run server via call to run_till_terminated
+ s.run_till_terminated_or_interrupted([1, 'int', 'SIGQUIT'])
end
main