Class: FileWatch::TailMode::Handlers::Grow

Inherits:
Base
  • Object
show all
Defined in:
lib/filewatch/tail_mode/handlers/grow.rb

Instance Attribute Summary

Attributes inherited from Base

#sincedb_collection

Instance Method Summary collapse

Methods inherited from Base

#handle, #initialize, #quit?, #update_existing_specifically

Constructor Details

This class inherits a constructor from FileWatch::TailMode::Handlers::Base

Instance Method Details

#handle_specifically(watched_file) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/filewatch/tail_mode/handlers/grow.rb', line 5

def handle_specifically(watched_file)
  watched_file.file_seek(watched_file.bytes_read)
  loop do
    break if quit?
    loop_control = watched_file.loop_control_adjusted_for_stat_size
    controlled_read(watched_file, loop_control)
    break unless loop_control.keep_looping?
  end
end