Sha256: 66ec06e2c3316d91c3e23cd58821d3143641756ef8de903a659205a19d15f34c

Contents?: true

Size: 433 Bytes

Versions: 1

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

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

  def start!
    init!
    after_init
    run!
    after_run
  end

  def init! = nil
  def run! = info { "Started" }

  # TODO: unsubscribe from everything on stop
  def stop! = info { "Stopped" }

  def after_init = nil
  def after_run = nil
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async-tools-0.2.10 lib/async/app/component.rb