lib/kafka/fetcher.rb in ruby-kafka-0.7.4 vs lib/kafka/fetcher.rb in ruby-kafka-0.7.5.beta1
- old
+ new
@@ -47,23 +47,24 @@
end
def start
return if @running
+ @running = true
+
@thread = Thread.new do
while @running
loop
end
@logger.info "Fetcher thread exited."
end
@thread.abort_on_exception = true
-
- @running = true
end
def stop
return unless @running
@commands << [:stop, []]
+ @thread.join
end
def reset
@current_reset_counter = current_reset_counter + 1
@commands << [:reset]