class QuickML::ServerMemory

Public Class Methods

init_catalog(memory) click to toggle source
# File vendor/qwik/lib/qwik/ml-memory.rb, line 27
def self.init_catalog(memory)
  memory[:catalog] = nil
  if memory[:message_catalog]
    cf = CatalogFactory.new
    cf.load_all_here('catalog-ml-??.rb')
    memory[:catalog] = cf.get_catalog('ja')
  end
end
init_logger(memory, config) click to toggle source
# File vendor/qwik/lib/qwik/ml-memory.rb, line 13
def self.init_logger(memory, config)
  ml_log_file = (config[:log_dir].path + Logger::ML_LOG_FILE).to_s
  memory[:logger] = Logger.new(ml_log_file, config[:verbose_mode])
end
init_mutex(memory) click to toggle source
# File vendor/qwik/lib/qwik/ml-memory.rb, line 18
def self.init_mutex(memory)
  memory[:ml_mutexes] = Hash.new
end
ml_mutex(memory, address) click to toggle source
# File vendor/qwik/lib/qwik/ml-memory.rb, line 22
def self.ml_mutex(memory, address)
  hash = memory[:ml_mutexes]
  return hash.fetch(address) {|x| hash[x] = Mutex.new }
end