Class: SyslogShipper::Client
- Inherits:
-
EventMachine::FileTail
- Object
- EventMachine::FileTail
- SyslogShipper::Client
- Defined in:
- lib/syslog_shipper/client.rb
Instance Method Summary collapse
-
#initialize(path, options = {:startpos => -1}) ⇒ Client
constructor
A new instance of Client.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(path, options = {:startpos => -1}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 |
# File 'lib/syslog_shipper/client.rb', line 5 def initialize path, = {:startpos => -1} super path, [:startpos] @buffer = BufferedTokenizer.new @hostname = Socket.gethostname @connection = [:connection] @raw = [:raw] @ping = [:ping] @verbose = [:verbose] end |
Instance Method Details
#receive_data(data) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/syslog_shipper/client.rb', line 15 def receive_data(data) @buffer.extract(data).each do |line| if @ping puts 'connection successful' exit end if = (line) puts if @verbose send_data end end end |