Class: Jiggler::Launcher

Inherits:
Object
  • Object
show all
Includes:
Support::Helper
Defined in:
lib/jiggler/launcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/jiggler/launcher.rb', line 7

def config
  @config
end

Instance Method Details

#startObject



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

#stopObject



31
32
33
34
35
# File 'lib/jiggler/launcher.rb', line 31

def stop
  suspend
  manager.terminate
  logger.debug('Manager terminated')
end

#suspendObject



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