Sha256: df014509ad57eb0b09967548273d7a628528b51bed939154332d5aeb3355a6e7

Contents?: true

Size: 445 Bytes

Versions: 4

Compression:

Stored size: 445 Bytes

Contents

# Common code shared between both readers and writers.
#
module Syslogstash::Worker
	# If you ever want to stop a reader, here's how.
	def stop
		if @worker
			@worker.kill
			@worker.join
			@worker = nil
		end
	end

	# If you want to wait for a reader to die, here's how.
	#
	def wait
		@worker.join
	end

	private

	def debug
		if ENV['DEBUG_SYSLOGSTASH']
			puts "#{Time.now.strftime("%F %T.%L")} #{self.class} #{yield.to_s}"
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
syslogstash-0.1.3 lib/syslogstash/worker.rb
syslogstash-0.1.2 lib/syslogstash/worker.rb
syslogstash-0.1.1 lib/syslogstash/worker.rb
syslogstash-0.1.0 lib/syslogstash/worker.rb