Sha256: 55b329e29fd08860540c63431473cf5a5c0697a1b1a7f4acf5862231f38cb50c

Contents?: true

Size: 769 Bytes

Versions: 54

Compression:

Stored size: 769 Bytes

Contents

module Protobuf
  module Rpc
    class SocketRunner

      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 parser Socket Server - server options"
                   end

        @server = ::Protobuf::Rpc::Socket::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

54 entries across 54 versions & 2 rubygems

Version Path
protobuffy-3.6.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuffy-3.5.1 lib/protobuf/rpc/servers/socket_runner.rb
protobuffy-3.4.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuffy-3.3.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuffy-3.2.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuffy-3.1.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.6 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.5 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.4 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.3 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.2 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.1 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.3.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.2.1 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.2.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.1.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.0.5 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.0.4 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-2.8.13 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.0.3 lib/protobuf/rpc/servers/socket_runner.rb