Made ruby server stop waiting for calls when it starts getting null calls

pull/3841/head
murgatroid99 9 years ago
parent 60f406ab74
commit 59e339b9d2
  1. 7
      src/ruby/lib/grpc/generic/rpc_server.rb

@ -417,7 +417,12 @@ module GRPC
begin
an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE)
c = new_active_server_call(an_rpc)
unless c.nil?
if c.nil?
# With infinite timeout on request_call, a nil call implies that the
# server has shut down. Waiting for another call at that point will
# not accomplish anything.
break
else
mth = an_rpc.method.to_sym
@pool.schedule(c) do |call|
rpc_descs[mth].run_server_method(call, rpc_handlers[mth])

Loading…
Cancel
Save