Module: Errands::Started

Defined in:
lib/errands/runner.rb

Instance Method Summary collapse

Instance Method Details

#run(*_) ⇒ Object Also known as: daemon, threaded_run, noop_run



54
55
56
57
58
59
60
# File 'lib/errands/runner.rb', line 54

def run(*_)
  new(*_).tap do |e|
    Process.daemon if (callee = __callee__) == :daemon
    startups << define_method(:startups_alternate_run) { { callee => true } } if __callee__ != __method__
    e.run
  end
end

#start(*_) ⇒ Object



50
51
52
# File 'lib/errands/runner.rb', line 50

def start(*_)
  new(*_).tap &:start
end

#started_workers(*_) ⇒ Object



66
67
68
# File 'lib/errands/runner.rb', line 66

def started_workers(*_)
  (@started_workers ||= [:worker]).concat _.flatten.map(&:to_sym)
end

#startupsObject



70
71
72
# File 'lib/errands/runner.rb', line 70

def startups
  @startups ||= [:minimal_startup]
end