Class: FileWatch::Processor
- Inherits:
-
Object
- Object
- FileWatch::Processor
show all
- Includes:
- LogStash::Util::Loggable
- Defined in:
- lib/filewatch/processor.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(settings) ⇒ Processor
Returns a new instance of Processor.
11
12
13
14
|
# File 'lib/filewatch/processor.rb', line 11
def initialize(settings)
@settings = settings
@deletable_paths = Concurrent::AtomicReference.new []
end
|
Instance Attribute Details
#watch ⇒ Object
Returns the value of attribute watch.
9
10
11
|
# File 'lib/filewatch/processor.rb', line 9
def watch
@watch
end
|
Instance Method Details
#add_deletable_path(path) ⇒ Object
25
26
27
|
# File 'lib/filewatch/processor.rb', line 25
def add_deletable_path(path)
@deletable_paths.get << path
end
|
#add_watch(watch) ⇒ Object
16
17
18
19
|
# File 'lib/filewatch/processor.rb', line 16
def add_watch(watch)
@watch = watch
self
end
|
#clear_deletable_paths ⇒ Object
21
22
23
|
# File 'lib/filewatch/processor.rb', line 21
def clear_deletable_paths
@deletable_paths.get_and_set []
end
|
#restat(watched_file) ⇒ Object
29
30
31
32
33
34
35
36
37
|
# File 'lib/filewatch/processor.rb', line 29
def restat(watched_file)
changed = watched_file.restat!
if changed
@watch.watched_files_collection.update(watched_file)
end
end
|