Class: Entrance::Agent::Haproxy
- Inherits:
-
Object
- Object
- Entrance::Agent::Haproxy
- Extended by:
- Globalizer
- Defined in:
- lib/entrance/agent/haproxy.rb
Instance Attribute Summary collapse
-
#backends ⇒ Object
Returns the value of attribute backends.
-
#haproxy ⇒ Object
Returns the value of attribute haproxy.
-
#http ⇒ Object
Returns the value of attribute http.
-
#https ⇒ Object
Returns the value of attribute https.
-
#services ⇒ Object
Returns the value of attribute services.
-
#synapse ⇒ Object
Returns the value of attribute synapse.
-
#thread ⇒ Object
Returns the value of attribute thread.
Attributes included from Globalizer
Instance Method Summary collapse
-
#initialize ⇒ Haproxy
constructor
A new instance of Haproxy.
- #start ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize ⇒ Haproxy
Returns a new instance of Haproxy.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/entrance/agent/haproxy.rb', line 16 def initialize Haproxy.current ||= self @haproxy = Synapse::Config::Haproxy.new Entrance.current @backends = Synapse::Config::Services.new @services = {} @synapse_config = { haproxy: haproxy, services: backends }.with_indifferent_access @synapse = Synapse::Synapse.new @synapse_config @synapse.services = backends Config.current.https_params.default_certificate = Entrance.current.certificate @http = Synapse::Easy::Section::Http.new Config.current.http_params @https = Synapse::Easy::Section::Http.new Config.current.https_params haproxy.extra_sections[http.label] = http haproxy.extra_sections[https.label] = https link_notifiers end |
Instance Attribute Details
#backends ⇒ Object
Returns the value of attribute backends.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def backends @backends end |
#haproxy ⇒ Object
Returns the value of attribute haproxy.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def haproxy @haproxy end |
#http ⇒ Object
Returns the value of attribute http.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def http @http end |
#https ⇒ Object
Returns the value of attribute https.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def https @https end |
#services ⇒ Object
Returns the value of attribute services.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def services @services end |
#synapse ⇒ Object
Returns the value of attribute synapse.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def synapse @synapse end |
#thread ⇒ Object
Returns the value of attribute thread.
13 14 15 |
# File 'lib/entrance/agent/haproxy.rb', line 13 def thread @thread end |
Instance Method Details
#start ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/entrance/agent/haproxy.rb', line 40 def start return if backends.empty? self.thread = Thread.new do synapse.run end @started = true end |