Class: Anschel::Input::Kafka

Inherits:
Base
  • Object
show all
Defined in:
lib/anschel/input/kafka.rb

Instance Method Summary collapse

Constructor Details

#initialize(output, config, stats, log) ⇒ Kafka

Returns a new instance of Kafka.



9
10
11
12
# File 'lib/anschel/input/kafka.rb', line 9

def initialize output, config, stats, log
  @consumer_group = ::Kafka::Group.new config
  @consumer_group.run num_cpus, output
end

Instance Method Details

#stopObject



14
15
16
17
18
# File 'lib/anschel/input/kafka.rb', line 14

def stop
  return if @stopped
  @consumer_group.shutdown
  @stopped = true
end