Scroll::FileSource
Inherits Scroll::Source < Reference < Object
Follows a file the way tail -F does: reads appended bytes live, reopens
across rotation (the name now points at a different inode), and seeks back
to 0 across truncation (the file shrank in place). When there is nothing new
it sleep-polls, which yields to the event loop. read only ever returns 0
when a termination condition (--pid gone, or the Linux writer-idle timer)
fires after the current file has been drained to EOF, so no trailing bytes
are lost.
Constants
NEWLINE = '\n'.ord.to_u8
SCAN_BLOCK = 8192
Constructors
new(path : String, poll : Time::Span, *, from_start : Bool = false, prime_lines : Int32 = 0, pid : Int32 | Nil = nil, watch_proc : Bool = false, watch_proc_timeout : Time::Span = 10.seconds)
SourceClass methods
Instance methods
close
Source