Sha256: 3270c590f987fc6bf03e7ea02e5740a8ea75732ed5ef3c3fa9a19e31765afabd

Contents?: true

Size: 731 Bytes

Versions: 81

Compression:

Stored size: 731 Bytes

Contents

module Protobuf
  module Rpc
    class SocketRunner

      def self.stop
        ::Protobuf::Rpc::Socket::Server.stop
      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

    end
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
protobuf-2.7.2-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.2 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.1-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.1 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.0-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.0.rc1-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.7.0.rc1 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.6-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.6 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.5-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.5 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.4-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.4 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.3-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.3 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.2-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.2 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.1-java lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.6.1 lib/protobuf/rpc/servers/socket_runner.rb