Module: Roma::AsyncProcess

Included in:
Romad
Defined in:
lib/roma/async_process.rb

Constant Summary collapse

@@async_queue =
Queue.new
@@async_queue_latency =
Queue.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.queueObject



37
38
39
# File 'lib/roma/async_process.rb', line 37

def self.queue
  @@async_queue
end

.queue_latencyObject



41
42
43
# File 'lib/roma/async_process.rb', line 41

def self.queue_latency
  @@async_queue_latency
end

Instance Method Details

#start_async_processObject



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/roma/async_process.rb', line 45

def start_async_process
  @async_thread = Thread.new do
    async_process_loop
  end
  @async_thread[:name] = __method__

  @async_thread_latency = Thread.new do
    async_process_loop_for_latency
  end
  @async_thread_latency[:name] = __method__
rescue => e
  @log.error("#{e}\n#{$ERROR_POSITION}")
end