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, #sign_message
Constructor Details
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
36 37 38 39 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 36 def first_alive_load_balance? ENV.key?("PB_FIRST_ALIVE_LOAD_BALANCE") || [:first_alive_load_balance] end |
#ping_port ⇒ Object
45 46 47 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 45 def ping_port @ping_port ||= ENV["PB_RPC_PING_PORT"] end |
#ping_port_enabled? ⇒ Boolean
49 50 51 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 49 def ping_port_enabled? ENV.key?("PB_RPC_PING_PORT") end |
#send_request ⇒ Object
41 42 43 |
# File 'lib/protobuf/rpc/connectors/base.rb', line 41 def send_request fail 'If you inherit a Connector from Base you must implement send_request' end |