Module: Syslogstash::Worker

Included in:
LogstashWriter, SyslogReader
Defined in:
lib/syslogstash/worker.rb

Overview

Common code shared between both readers and writers.

Instance Method Summary collapse

Instance Method Details

#stopObject

If you ever want to stop a reader, here’s how.



5
6
7
8
9
10
11
# File 'lib/syslogstash/worker.rb', line 5

def stop
  if @worker
    @worker.kill
    @worker.join
    @worker = nil
  end
end

#threadObject



13
14
15
# File 'lib/syslogstash/worker.rb', line 13

def thread
  @worker
end

#waitObject

If you want to wait for a reader to die, here’s how.



19
20
21
# File 'lib/syslogstash/worker.rb', line 19

def wait
  @worker.join
end