Class: Jiggler::Launcher
- Inherits:
-
Object
- Object
- Jiggler::Launcher
- Includes:
- Support::Helper
- Defined in:
- lib/jiggler/launcher.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ Launcher
constructor
A new instance of Launcher.
- #start ⇒ Object
- #stop ⇒ Object
- #suspend ⇒ Object
Methods included from Support::Helper
#log_error, #log_error_short, #logger, #safe_async, #scan_all, #tid
Constructor Details
#initialize(config) ⇒ Launcher
Returns a new instance of Launcher.
9 10 11 12 |
# File 'lib/jiggler/launcher.rb', line 9 def initialize(config) @done = false @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/jiggler/launcher.rb', line 7 def config @config end |
Instance Method Details
#start ⇒ Object
14 15 16 17 18 |
# File 'lib/jiggler/launcher.rb', line 14 def start poller.start if config[:poller_enabled] monitor.start manager.start end |
#stop ⇒ Object
31 32 33 34 35 |
# File 'lib/jiggler/launcher.rb', line 31 def stop suspend manager.terminate logger.debug('Manager terminated') end |
#suspend ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jiggler/launcher.rb', line 20 def suspend return if @done @done = true manager.suspend logger.debug('Manager suspended') poller.terminate if config[:poller_enabled] monitor.terminate end |