Changed some 'require' to 'require_relative' and modified rpc_server slightly

pull/6266/head
murgatroid99 9 years ago
parent ddaa69f15d
commit 79108d0fdb
  1. 20
      src/ruby/lib/grpc.rb
  2. 2
      src/ruby/lib/grpc/core/time_consts.rb
  3. 2
      src/ruby/lib/grpc/errors.rb
  4. 2
      src/ruby/lib/grpc/generic/active_call.rb
  5. 2
      src/ruby/lib/grpc/generic/bidi_call.rb
  6. 4
      src/ruby/lib/grpc/generic/client_stub.rb
  7. 2
      src/ruby/lib/grpc/generic/rpc_desc.rb
  8. 14
      src/ruby/lib/grpc/generic/rpc_server.rb
  9. 4
      src/ruby/lib/grpc/generic/service.rb
  10. 4
      src/ruby/lib/grpc/grpc.rb

@ -32,13 +32,13 @@ unless ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH']
ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] = ssl_roots_path
end
require 'grpc/errors'
require 'grpc/grpc'
require 'grpc/logconfig'
require 'grpc/notifier'
require 'grpc/version'
require 'grpc/core/time_consts'
require 'grpc/generic/active_call'
require 'grpc/generic/client_stub'
require 'grpc/generic/service'
require 'grpc/generic/rpc_server'
require_relative 'grpc/errors'
require_relative 'grpc/grpc'
require_relative 'grpc/logconfig'
require_relative 'grpc/notifier'
require_relative 'grpc/version'
require_relative 'grpc/core/time_consts'
require_relative 'grpc/generic/active_call'
require_relative 'grpc/generic/client_stub'
require_relative 'grpc/generic/service'
require_relative 'grpc/generic/rpc_server'

@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc/grpc'
require_relative '../grpc'
# GRPC contains the General RPC module.
module GRPC

@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc/grpc'
require_relative './grpc'
# GRPC contains the General RPC module.
module GRPC

@ -28,7 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'forwardable'
require 'grpc/generic/bidi_call'
require_relative 'bidi_call'
class Struct
# BatchResult is the struct returned by calls to call#start_batch.

@ -28,7 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'forwardable'
require 'grpc/grpc'
require_relative '../grpc'
# GRPC contains the General RPC module.
module GRPC

@ -27,8 +27,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc/generic/active_call'
require 'grpc/version'
require_relative 'active_call'
require_relative '../version'
# GRPC contains the General RPC module.
module GRPC

@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc/grpc'
require_relative '../grpc'
# GRPC contains the General RPC module.
module GRPC

@ -27,9 +27,9 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc/grpc'
require 'grpc/generic/active_call'
require 'grpc/generic/service'
require_relative '../grpc'
require_relative 'active_call'
require_relative 'service'
require 'thread'
# A global that contains signals the gRPC servers should respond to.
@ -332,10 +332,15 @@ module GRPC
# the current thread to terminate it.
def run_till_terminated
GRPC.trap_signals
t = Thread.new { run }
stopped = false
t = Thread.new do
run
stopped = true
end
wait_till_running
loop do
sleep SIGNAL_CHECK_PERIOD
break if stopped
break unless GRPC.handle_signals
end
stop
@ -434,7 +439,6 @@ module GRPC
begin
an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE)
break if (!an_rpc.nil?) && an_rpc.call.nil?
active_call = new_active_server_call(an_rpc)
unless active_call.nil?
@pool.schedule(active_call) do |ac|

@ -27,8 +27,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc/generic/client_stub'
require 'grpc/generic/rpc_desc'
require_relative 'client_stub'
require_relative 'rpc_desc'
# GRPC contains the General RPC module.
module GRPC

@ -28,7 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
begin
require "grpc/#{RUBY_VERSION.sub(/\.\d$/, '')}/grpc_c"
require_relative "#{RUBY_VERSION.sub(/\.\d$/, '')}/grpc_c"
rescue LoadError
require 'grpc/grpc_c'
require_relative 'grpc_c'
end

Loading…
Cancel
Save