Class: Synapse::Synapse
- Inherits:
-
Object
- Object
- Synapse::Synapse
- Defined in:
- lib/boutons/synapse.rb
Instance Method Summary collapse
- #add_service(service) ⇒ Object
- #reconfigure! ⇒ Object
- #service_watchers ⇒ Object
- #services=(services) ⇒ Object
Instance Method Details
#add_service(service) ⇒ Object
6 7 8 9 |
# File 'lib/boutons/synapse.rb', line 6 def add_service service @service_watchers ||= [] @service_watchers << ServiceWatcher.create(service.name, service, self) end |
#reconfigure! ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/boutons/synapse.rb', line 13 def reconfigure! return if @reconfiguring @reconfiguring = true @services.select{|n,s|!s.active}.each do |name,config| log.info "attach service #{name}" watcher = ServiceWatcher.create(name, config, self) watcher.start config.active=true @service_watchers << watcher end if @services @reconfiguring = false @config_updated = true end |
#service_watchers ⇒ Object
10 11 12 |
# File 'lib/boutons/synapse.rb', line 10 def service_watchers @service_watchers end |
#services=(services) ⇒ Object
3 4 5 |
# File 'lib/boutons/synapse.rb', line 3 def services= services @services = services end |