Class: Protobuf::Rpc::Connectors::Base
- Inherits:
-
Object
- Object
- Protobuf::Rpc::Connectors::Base
- Includes:
- Logging
- Defined in:
- lib/protobuf/rpc/connectors/base.rb
Instance Attribute Summary collapse
-
#complete_cb ⇒ Object
Returns the value of attribute complete_cb.
-
#failure_cb ⇒ Object
Returns the value of attribute failure_cb.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#success_cb ⇒ Object
Returns the value of attribute success_cb.
Instance Method Summary collapse
- #first_alive_load_balance? ⇒ Boolean
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
- #ping_port ⇒ Object
- #ping_port_enabled? ⇒ Boolean
- #send_request ⇒ Object
Methods included from Logging
initialize_logger, #log_exception, #log_signature, #logger, logger, logger=, #sign_message
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
31 32 33 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 31 def initialize() @options = DEFAULT_OPTIONS.merge() end |
Instance Attribute Details
#complete_cb ⇒ Object
Returns the value of attribute complete_cb.
29 30 31 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 29 def complete_cb @complete_cb end |
#failure_cb ⇒ Object
Returns the value of attribute failure_cb.
29 30 31 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 29 def failure_cb @failure_cb end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
28 29 30 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 28 def @options end |
#success_cb ⇒ Object
Returns the value of attribute success_cb.
29 30 31 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 29 def success_cb @success_cb end |
Instance Method Details
#first_alive_load_balance? ⇒ Boolean
35 36 37 38 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 35 def first_alive_load_balance? ENV.has_key?("PB_FIRST_ALIVE_LOAD_BALANCE") || [:first_alive_load_balance] end |
#ping_port ⇒ Object
44 45 46 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 44 def ping_port @ping_port ||= ENV["PB_RPC_PING_PORT"] end |
#ping_port_enabled? ⇒ Boolean
48 49 50 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 48 def ping_port_enabled? ENV.has_key?("PB_RPC_PING_PORT") end |
#send_request ⇒ Object
40 41 42 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 40 def send_request raise 'If you inherit a Connector from Base you must implement send_request' end |