Sha256: 1b3a061bdeb2b633e49ab018cb54d7e62ab38da5e9a6e72decf403de6505184b

Contents?: true

Size: 1.45 KB

Versions: 20

Compression:

Stored size: 1.45 KB

Contents

require 'protobuf/logger'
require 'protobuf/rpc/rpc.pb'
require 'protobuf/rpc/buffer'
require 'protobuf/rpc/error'
require 'protobuf/rpc/stat'
require 'protobuf/rpc/connectors/common'

module Protobuf
  module Rpc
    module Connectors
      DEFAULT_OPTIONS = {
        :service        => nil,           # Fully-qualified Service class
        :method         => nil,           # Service method to invoke
        :host           => '127.0.0.1',   # The hostname or address of the service (usually overridden or pre-configured)
        :port           => '9399',        # The port of the service (usually overridden or pre-configured)
        :request        => nil,           # The request object sent by the client
        :request_type   => nil,           # The request type expected by the client
        :response_type  => nil,           # The response type expected by the client
        :timeout        => 30,            # The default timeout for the request, also handled by client.rb
        :client_host    => nil            # The hostname or address of this client
      }

      class Base
        include Protobuf::Logger::LogMethods

        attr_reader :options
        attr_accessor :success_cb, :failure_cb, :complete_cb

        def initialize(options)
          @options = DEFAULT_OPTIONS.merge(options)
        end

        def send_request
          raise 'If you inherit a Connector from Base you must implement send_request'
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
protobuf-2.6.5-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.5 lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.4-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.4 lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.3-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.3 lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.2-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.2 lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.1-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.1 lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.0-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.6.0 lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.5-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.5 lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.4-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.4 lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.3 lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.2-java lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.2 lib/protobuf/rpc/connectors/base.rb
protobuf-2.5.1 lib/protobuf/rpc/connectors/base.rb