Module: Async::App::Component

Included in:
Async::App, EventLogger, WebServer
Defined in:
lib/async/app/component.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
# File 'lib/async/app/component.rb', line 4

def self.included(base)
  base.extend(Async::App::Injector)
  base.inject(:bus)
  base.include(Async::Logger)
end

Instance Method Details

#after_initObject



23
# File 'lib/async/app/component.rb', line 23

def after_init = nil

#after_runObject



24
# File 'lib/async/app/component.rb', line 24

def after_run = nil

#init!Object



17
# File 'lib/async/app/component.rb', line 17

def init! = nil

#run!Object



18
# File 'lib/async/app/component.rb', line 18

def run! = info { "Started" }

#start!Object



10
11
12
13
14
15
# File 'lib/async/app/component.rb', line 10

def start!
  init!
  after_init
  run!
  after_run
end

#stop!Object

TODO: unsubscribe from everything on stop



21
# File 'lib/async/app/component.rb', line 21

def stop! = info { "Stopped" }