Sha256: 7747560f376353c563908769d9fca32cd776952e3cae6094c4a1b964e69b8cfb

Contents?: true

Size: 507 Bytes

Versions: 106

Compression:

Stored size: 507 Bytes

Contents

module LogjamAgent
  module Forwarders
    @@forwarders = {}

    extend self

    def add(f)
      @@forwarders["#{f.app}-#{f.env}"] = f
    end

    def get(app, env)
      @@forwarders["#{app}-#{env}"]
    end

    def reset
      @@forwarders.each_value {|f| f.reset}
    end

    # properly close AMQP connections on program termination
    # this avoids 'connection_closed_abruptly' in the rabbit logs
    at_exit { reset }

    def inspect
      super + ": #{@@forwarders.inspect}"
    end
  end
end

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
logjam_agent-0.27.0 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.6 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.5 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.4 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.3 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.2 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.1 lib/logjam_agent/forwarders.rb
logjam_agent-0.26.0 lib/logjam_agent/forwarders.rb
logjam_agent-0.25.3 lib/logjam_agent/forwarders.rb
logjam_agent-0.25.2 lib/logjam_agent/forwarders.rb
logjam_agent-0.25.1 lib/logjam_agent/forwarders.rb
logjam_agent-0.25.0 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.10 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.9 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.8 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.7 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.6 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.5 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.4 lib/logjam_agent/forwarders.rb
logjam_agent-0.24.3 lib/logjam_agent/forwarders.rb