Class: GraphiteAPI::Connector::Group
- Inherits:
-
Object
- Object
- GraphiteAPI::Connector::Group
- Defined in:
- lib/graphite-api/connector.rb
Instance Method Summary collapse
-
#check! ⇒ Object
init all sockets in group.
-
#initialize(options) ⇒ Group
constructor
A new instance of Group.
- #publish(messages) ⇒ Object
Constructor Details
#initialize(options) ⇒ Group
Returns a new instance of Group.
76 77 78 |
# File 'lib/graphite-api/connector.rb', line 76 def initialize @connectors = [:backends].map(&Connector.method(:new)) end |
Instance Method Details
#check! ⇒ Object
init all sockets in group. should throw exception on Socket errors.
87 88 89 90 91 92 93 94 95 |
# File 'lib/graphite-api/connector.rb', line 87 def check! @connectors.each do |c| begin c.check! rescue Exception => e raise e, "#{c.uri}: #{e.message}", e.backtrace end end end |
#publish(messages) ⇒ Object
80 81 82 83 |
# File 'lib/graphite-api/connector.rb', line 80 def publish Logger.debug [:connector_group, :publish, .size, @connectors] Array().each { |msg| @connectors.map {|c| c.puts msg} } end |