Class: Harmoniser::Launcher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/harmoniser/launcher/base.rb

Direct Known Subclasses

Bounded, UnBounded

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration:, logger:) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
# File 'lib/harmoniser/launcher/base.rb', line 10

def initialize(configuration:, logger:)
  @configuration = configuration
  @logger = logger
  @subscribers = Subscriber.registry
end

Instance Attribute Details

#subscribersObject (readonly)

Returns the value of attribute subscribers.



8
9
10
# File 'lib/harmoniser/launcher/base.rb', line 8

def subscribers
  @subscribers
end

Instance Method Details

#startObject



16
17
18
19
20
# File 'lib/harmoniser/launcher/base.rb', line 16

def start
  boot_app
  start_subscribers
  @logger.info("Subscribers registered to consume messages from queues: klasses = `#{@subscribers}`")
end

#stopObject



22
23
24
25
26
# File 'lib/harmoniser/launcher/base.rb', line 22

def stop
  @logger.info("Shutting down!")
  maybe_close
  @logger.info("Bye!")
end