Module: DTAS::Watchable
- Included in:
- Source::SplitFX
- Defined in:
- lib/dtas/watchable.rb
Overview
used to restart DTAS::Source::SplitFX processing in dtas-player if the YAML file is edited
Defined Under Namespace
Classes: InotifyReadableIter
Instance Method Summary collapse
- #watch_begin(blk) ⇒ Object
-
#watch_end(srv) ⇒ Object
Closing the inotify descriptor (instead of using inotify_rm_watch) is cleaner because it avoids EINVAL on race conditions in case a directory is deleted: lkml.org/lkml/2007/7/9/3.
- #watch_extra(paths) ⇒ Object
Instance Method Details
#watch_begin(blk) ⇒ Object
48 49 50 51 52 |
# File 'lib/dtas/watchable.rb', line 48 def watch_begin(blk) @ino = InotifyReadableIter.new @ino.watch_files(@watch_extra << @infile, blk) @ino end |
#watch_end(srv) ⇒ Object
Closing the inotify descriptor (instead of using inotify_rm_watch) is cleaner because it avoids EINVAL on race conditions in case a directory is deleted: lkml.org/lkml/2007/7/9/3
61 62 63 64 |
# File 'lib/dtas/watchable.rb', line 61 def watch_end(srv) srv.wait_ctl(@ino, :delete) @ino = @ino.close end |
#watch_extra(paths) ⇒ Object
54 55 56 |
# File 'lib/dtas/watchable.rb', line 54 def watch_extra(paths) @ino.watch_extra(paths) end |