Mx.Watcher (mx v0.1.0)

Copy Markdown View Source

Loads a song file again whenever its content changes, and hands each version that loads to on_song. A version that does not load prints its error, and the playing version stays.

It compares the content rather than the modification time, since that time has a resolution of one second and two quick saves would look like one.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts watching the song file at :path, handing each version that loads to :on_song.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

Starts watching the song file at :path, handing each version that loads to :on_song.