Tail
Tail implements a simple file tail functionality.
Given a file, a function, and an interval, Tail will execute the function with a list of new lines found in the file and continue checking for additional lines on the interval.
Usage
{:ok, pid} = Tail.start_link(“test.txt”, &IO.inspect(&1), 1000) Tail.stop(pid)
Summary↑
start_link(file, fun, interval \\ 1000) | Public interface. Starts a Tail Genserver for the given file, function, and interval (in ms) |
stop(pid) | Public interface. Sends a call to kill the GenServer |
Types ↑
Functions
Specs:
- start_link(String.t, ([String.t] -> nil), Integer) :: GenServer.on_start
Public interface. Starts a Tail Genserver for the given file, function, and interval (in ms)
Specs:
- stop(pid) :: :ok
Public interface. Sends a call to kill the GenServer