Class: Daemon::Coordinator Deprecated

Inherits:
Object
  • Object
show all
Extended by:
Utils::Loggable, Forwardable, MonitorMixin
Defined in:
lib/onapp/engine/coordinator.rb

Overview

Deprecated.

Instance Attribute Summary

Attributes included from Utils::Loggable

#logger

Class Method Summary (collapse)

Methods included from Utils::Loggable

debug, error, fatal, info, lwarn

Class Method Details

+ (Object) adjust_activity



38
39
40
41
42
43
44
45
46
47
# File 'lib/onapp/engine/coordinator.rb', line 38

def adjust_activity
  unless EM.reactor_running?
    logger.warn("======== Activity can not be performed yet ========")
    return
  end

  logger.warn("======== Performing activity ========")
  Daemon.supervision.clear_timers
  Daemon.supervision.setup_timers
end

+ (Object) initialize_activity



22
23
24
25
26
27
28
29
30
# File 'lib/onapp/engine/coordinator.rb', line 22

def initialize_activity
  info { "======== Initializing Activity ======== " }
  info { "Registering subscribers: #{Daemon.supervision.handlers.map(&:name).join(', ')}" }
  Daemon.supervision.subscribe
  Daemon.callbacks.invoke_initialize_activity
rescue => e
  error { "======== Activity initialization failed ======== " }
  debug { "ACTIVITY: Error #{e.class}: #{e.message}\n#{e.backtrace.join("\n")}" }
end

+ (Object) logger



14
15
16
17
18
19
20
# File 'lib/onapp/engine/coordinator.rb', line 14

def logger
  @logger ||=
    begin
      @facility = 'Coordinator'
      Daemon.logger
    end
end

+ (Object) stop_activity



32
33
34
35
36
# File 'lib/onapp/engine/coordinator.rb', line 32

def stop_activity
  logger.warn("======== Stopping ALL activity ======== ")
  Daemon.supervision.clear_timers
  Daemon.callbacks.invoke_stop_activity
end