Class: ThreadWatcher::Monitor
- Inherits:
-
Object
- Object
- ThreadWatcher::Monitor
- Includes:
- Singleton
- Defined in:
- lib/thread_watcher.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Monitor
constructor
A new instance of Monitor.
- #kill!(id) ⇒ Object
- #restart(id) ⇒ Object
- #run(options = {}, &block) ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize ⇒ Monitor
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 = {}, &block instance.run , &block end |
.status ⇒ Object
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 = {}, &block @process_watch.run , &block end |
#status ⇒ Object
39 40 41 |
# File 'lib/thread_watcher.rb', line 39 def status @process_watch.status end |