Sha256: 17d11c5db189b5a17cc8342370582194e7ce411ec4bd1b682f5f9258bc3193c5

Contents?: true

Size: 755 Bytes

Versions: 13

Compression:

Stored size: 755 Bytes

Contents

module Protobuf
  module Rpc
    class SocketRunner

      private

      attr_accessor :server

      public

      def initialize(options)
        options = case
                  when options.is_a?(OpenStruct) then
                    options.marshal_dump
                  when options.respond_to?(:to_hash) then
                    options.to_hash.symbolize_keys
                  else
                    fail "Cannot parser Socket Server - server options"
                  end

        self.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

13 entries across 13 versions & 1 rubygems

Version Path
protobuf-3.6.12 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.11 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.10 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.7.0.pre2 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.9 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.7.0.pre1 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.7.0.pre0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.7 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.6 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.2 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.1 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.6.0 lib/protobuf/rpc/servers/socket_runner.rb
protobuf-3.5.5 lib/protobuf/rpc/servers/socket_runner.rb