Class: Sqreen::Kit::Signals::BatchCollector::ProcessingLoop

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/sqreen/kit/signals/batch_collector.rb

Instance Method Summary collapse

Constructor Details

#initialize(collector) ⇒ ProcessingLoop

Returns a new instance of ProcessingLoop.

Parameters:



66
67
68
69
70
# File 'lib/sqreen/kit/signals/batch_collector.rb', line 66

def initialize(collector)
  @collector = collector
  @next_batch = []
  @deadline = nil
end

Instance Method Details

#flush_sizeObject



80
81
82
# File 'lib/sqreen/kit/signals/batch_collector.rb', line 80

def flush_size
  @collector.flush_size
end

#max_batch_sizeObject



76
77
78
# File 'lib/sqreen/kit/signals/batch_collector.rb', line 76

def max_batch_size
  @collector.max_batch_size
end

#queueObject



72
73
74
# File 'lib/sqreen/kit/signals/batch_collector.rb', line 72

def queue
  @collector.queue
end

#runObject



84
85
86
87
# File 'lib/sqreen/kit/signals/batch_collector.rb', line 84

def run
  while run_loop_once; end
  logger.info 'Collector thread exiting'
end