Sha256: ebd48f347d7bdde9c4946430530451b206c43a0c96c844b0e3c2b190627ae861

Contents?: true

Size: 789 Bytes

Versions: 19

Compression:

Stored size: 789 Bytes

Contents

module Protobuf
  module Rpc
    class SocketRunner

      def self.register_signals
        # noop
      end

      def self.run(server)
        server_config = case
                        when server.is_a?(OpenStruct) then
                          server.marshal_dump
                        when server.is_a?(Hash) then
                          server
                        when server.respond_to?(:to_hash) then
                          server.to_hash
                        else
                          raise "Cannot parser Socket Server - server options"
                        end

				yield if block_given?
        ::Protobuf::Rpc::Socket::Server.run(server_config)
      end

      def self.stop
        ::Protobuf::Rpc::Socket::Server.stop
      end

    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
protobuf-2.7.12 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.11-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.11 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.10-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.10 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.9-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.9 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.8-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.8 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.7-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.7 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.6-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.6 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.5-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.5 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.4-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.4 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.3-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.3 lib/protobuf/rpc/servers/socket_runner.rb