Sha256: cee45c55f4119bb559d61a724b72ae6776fbb62df79d9e72b323c3726ce67c5e

Contents?: true

Size: 510 Bytes

Versions: 10

Compression:

Stored size: 510 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)
      @dns_mutex.synchronize { dns_data[name] = { 'port' => port } }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
invoker-1.4.1 lib/invoker/dns_cache.rb
invoker-1.4.0 lib/invoker/dns_cache.rb
invoker-1.3.2 lib/invoker/dns_cache.rb
invoker-1.3.1 lib/invoker/dns_cache.rb
invoker-1.3.0 lib/invoker/dns_cache.rb
invoker-1.2.0 lib/invoker/dns_cache.rb
invoker-1.2.0.pre2 lib/invoker/dns_cache.rb
invoker-1.2.0.pre1 lib/invoker/dns_cache.rb
invoker-1.2.0.pre lib/invoker/dns_cache.rb
invoker-1.1.0 lib/invoker/dns_cache.rb