Struct cernan::source::FileServer [] [src]

pub struct FileServer { /* fields omitted */ }

FileServer is a Source which cooperatively schedules reads over files, converting the lines of said files into LogLine structures. As FileServer is intended to be useful across multiple operating systems with POSIX filesystem semantics FileServer must poll for changes. That is, no event notification is used by FileServer.

FileServer is configured on a path to watch. The files do not need to exist at cernan startup. FileServer will discover new files which match its path in at most 60 seconds.

Trait Implementations

impl Source<FileServerConfig> for FileServer
[src]

FileServer as Source

The 'run' of FileServer performs the cooperative scheduling of reads over FileServer's configured files. Much care has been taking to make this scheduling 'fair', meaning busy files do not drown out quiet files or vice versa but there's no one perfect approach. Very fast files will be lost if your system aggressively rolls log files. FileServer will keep a file handler open but should your system move so quickly that a file disappears before cernan is able to open it the contents will be lost. This should be a rare occurence.

Specific operating systems support evented interfaces that correct this problem but your intrepid authors know of no generic solution.

[src]

Make a FileServer

[src]

Run method invoked by RunnableSource. It is from this method that Sources produce metric::Events. Read more

[src]

Constructs a so-called runnable source for the given Source and config.` See RunnableSource. Read more

Auto Trait Implementations

impl Send for FileServer

impl Sync for FileServer