Sha256: faf9730f107ba1686f886ef9da9f2c1f927f3bffd26326b11e38b6009299bbfc

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true
require 'grpc'
require 'anycable/rpc_handler'

# Set GRPC logger
module GRPC
  def self.logger
    Anycable.logger
  end
end

module Anycable
  # Wrapper over GRPC server
  module Server
    class << self
      attr_accessor :grpc_server

      def start
        @grpc_server = GRPC::RpcServer.new
        grpc_server.add_http2_port(Anycable.config.rpc_host, :this_port_is_insecure)
        grpc_server.handle(Anycable::RPCHandler)
        Anycable.logger.info "RPC server is listening on #{Anycable.config.rpc_host}"
        grpc_server.run_till_terminated
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
anycable-0.4.5 lib/anycable/server.rb
anycable-0.4.4 lib/anycable/server.rb
anycable-0.4.3 lib/anycable/server.rb
anycable-0.4.2 lib/anycable/server.rb
anycable-0.4.1 lib/anycable/server.rb
anycable-0.4.0 lib/anycable/server.rb