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