Sha256: 73decf680d665054600e99b4acdfa9169e99fbd17216161a1bdb7a3723033b09

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

module Nonnative
  class GRPCServer < Nonnative::Server
    def initialize(service)
      @server = GRPC::RpcServer.new

      server.add_http2_port("0.0.0.0:#{service.port}", :this_port_is_insecure)
      configure server

      super service
    end

    def configure(grpc)
      # Classes will add configuration
    end

    def perform_start
      server.run
    end

    def perform_stop
      server.stop
    end

    protected

    def wait_start
      server.wait_till_running(1)
    end

    private

    attr_reader :server
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nonnative-1.12.0 lib/nonnative/grpc_server.rb