Method: GRPC::RpcServer#available?
- Defined in:
- src/ruby/lib/grpc/generic/rpc_server.rb
#available?(an_rpc) ⇒ Boolean
Sends RESOURCE_EXHAUSTED if there are too many unprocessed jobs
418 419 420 421 422 423 424 425 426 427 428 429 430 |
# File 'src/ruby/lib/grpc/generic/rpc_server.rb', line 418 def available?(an_rpc) return an_rpc if @pool.ready_for_work? GRPC.logger.warn('no free worker threads currently') noop = proc { |x| x } # Create a new active call that knows that metadata hasn't been # sent yet c = ActiveCall.new(an_rpc.call, noop, noop, an_rpc.deadline, metadata_received: true, started: false) c.send_status(GRPC::Core::StatusCodes::RESOURCE_EXHAUSTED, 'No free threads in thread pool') nil end |