Class: ThreadWatcher::Monitor

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/thread_watcher.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMonitor

Returns a new instance of Monitor.



11
12
13
# File 'lib/thread_watcher.rb', line 11

def initialize
  @process_watch = ThreadWatcher::ProcessWatch.new
end

Class Method Details

.kill!(id) ⇒ Object



27
28
29
# File 'lib/thread_watcher.rb', line 27

def self.kill! id
  instance.kill! id
end

.restart(id) ⇒ Object



35
36
37
# File 'lib/thread_watcher.rb', line 35

def self.restart id
  instance.restart id
end

.run(options = {}, &block) ⇒ Object



19
20
21
# File 'lib/thread_watcher.rb', line 19

def self.run options = {}, &block
  instance.run options, &block
end

.statusObject



43
44
45
# File 'lib/thread_watcher.rb', line 43

def self.status
  instance.status
end

Instance Method Details

#kill!(id) ⇒ Object



23
24
25
# File 'lib/thread_watcher.rb', line 23

def kill! id
  @process_watch.kill! id
end

#restart(id) ⇒ Object



31
32
33
# File 'lib/thread_watcher.rb', line 31

def restart id
  @process_watch.restart id
end

#run(options = {}, &block) ⇒ Object



15
16
17
# File 'lib/thread_watcher.rb', line 15

def run options = {}, &block
  @process_watch.run options, &block
end

#statusObject



39
40
41
# File 'lib/thread_watcher.rb', line 39

def status
  @process_watch.status
end