Sha256: b5e0a0e08eace390e3e9eb3f70f1376b39e734b922c6a0569ed7ad40932342cd
Contents?: true
Size: 470 Bytes
Versions: 14
Compression:
Stored size: 470 Bytes
Contents
# encoding: utf-8 require "logstash/devutils/rspec/spec_helper" # this has been taken from the udp input, it should be DRYed class TcpHelpers def pipelineless_input(plugin, size, &block) queue = Queue.new input_thread = Thread.new do plugin.run(queue) end block.call sleep 0.1 while queue.size != size result = size.times.inject([]) do |acc| acc << queue.pop end plugin.do_stop input_thread.join result end end
Version data entries
14 entries across 14 versions & 2 rubygems