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