Sha256: 75f37fba405fe2736f43e982b60da263dc97128f3d4bd00e49b147a0a96773bf

Contents?: true

Size: 512 Bytes

Versions: 9

Compression:

Stored size: 512 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

	def thread
		@worker
	end

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

	private

	def log
		$stderr.puts "[#{self.class}] #{yield.to_s}"
	end

	def debug
		if ENV['DEBUG_SYSLOGSTASH']
			$stderr.puts "[#{self.class}] #{yield.to_s}"
		end
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
syslogstash-1.3.0 lib/syslogstash/worker.rb
syslogstash-1.2.1 lib/syslogstash/worker.rb
syslogstash-1.2.0 lib/syslogstash/worker.rb
syslogstash-1.1.2 lib/syslogstash/worker.rb
syslogstash-1.1.1 lib/syslogstash/worker.rb
syslogstash-1.1.0 lib/syslogstash/worker.rb
syslogstash-1.0.2 lib/syslogstash/worker.rb
syslogstash-1.0.1 lib/syslogstash/worker.rb
syslogstash-1.0.0 lib/syslogstash/worker.rb