Sha256: b15edea8ebcf3aa398fb9958724df716daedea6c76c1b1b1a581c96169808ec8

Contents?: true

Size: 532 Bytes

Versions: 10

Compression:

Stored size: 532 Bytes

Contents

module Invoker
  class DNSCache
    attr_accessor :dns_data

    def initialize(config)
      self.dns_data = {}
      @dns_mutex = Mutex.new
      Invoker.config.processes.each do |process|
        if process.port
          dns_data[process.label] = { 'port' => process.port }
        end
      end
    end

    def [](process_name)
      @dns_mutex.synchronize { dns_data[process_name] }
    end

    def add(name, port, ip = nil)
      @dns_mutex.synchronize { dns_data[name] = { 'port' => port, 'ip' => ip } }
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
itrg-invoker-1.6.1 lib/invoker/dns_cache.rb
itrg-invoker-1.6.0 lib/invoker/dns_cache.rb
invoker-1.5.8 lib/invoker/dns_cache.rb
invoker-1.5.7 lib/invoker/dns_cache.rb
invoker-1.5.6 lib/invoker/dns_cache.rb
invoker-1.5.5 lib/invoker/dns_cache.rb
invoker-1.5.4 lib/invoker/dns_cache.rb
invoker-1.5.3 lib/invoker/dns_cache.rb
meepo-1.5.2 lib/invoker/dns_cache.rb
invoker-1.5.1 lib/invoker/dns_cache.rb