Sha256: f38a4bf34f619dde0e9d84894794a92a71cd85ee2c913ff5b341b06b72444989

Contents?: true

Size: 762 Bytes

Versions: 8

Compression:

Stored size: 762 Bytes

Contents

module Protobuf
  module Rpc
    class HttpRunner

      def initialize(options)
        @options = case
                   when options.is_a?(OpenStruct) then
                     options.marshal_dump
                   when options.is_a?(Hash) then
                     options
                   when options.respond_to?(:to_hash) then
                     options.to_hash
                   else
                     raise "Cannot parse HTTP Server - server options"
                   end

        @server = ::Protobuf::Rpc::Http::Server.new(@options)
      end

      def run
        yield if block_given?
        @server.run
      end

      def running?
        @server.running?
      end

      def stop
        @server.stop
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
protobuffy-4.0.1 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-4.0.0 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-3.6.0 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-3.5.1 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-3.4.0 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-3.3.0 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-3.2.0 lib/protobuf/rpc/servers/http_runner.rb
protobuffy-3.1.0 lib/protobuf/rpc/servers/http_runner.rb