Skip to content
Snippets Groups Projects
Commit 7a32e8a4 authored by Alexander Polcyn's avatar Alexander Polcyn
Browse files

Revert changes to example greeter client

parent c44c16e3
No related branches found
No related tags found
No related merge requests found
...@@ -40,39 +40,11 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) ...@@ -40,39 +40,11 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
require 'grpc' require 'grpc'
require 'helloworld_services_pb' require 'helloworld_services_pb'
$int_count = 0
def shut_down_term
puts "term sig"
$int_count += 1
if $int_count > 4
exit
end
end
def shut_down_kill
puts "kill sig"
$int_count += 1
if $int_count > 4
exit
end
end
def main def main
stub = Helloworld::Greeter::Stub.new('localhost:50051', :this_channel_is_insecure) stub = Helloworld::Greeter::Stub.new('localhost:50051', :this_channel_is_insecure)
user = ARGV.size > 0 ? ARGV[0] : 'world' user = ARGV.size > 0 ? ARGV[0] : 'world'
Signal.trap("TERM") do message = stub.say_hello(Helloworld::HelloRequest.new(name: user)).message
shut_down_term p "Greeting: #{message}"
end
Signal.trap("INT") do
shut_down_kill
end
loop do
message = stub.say_hello(Helloworld::HelloRequest.new(name: user)).message
p "Greeting: #{message}"
sleep 4
end
end end
main main
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment