Module: StalkBoss

Defined in:
lib/stalk_boss.rb

Defined Under Namespace

Classes: Stalk

Instance Method Summary collapse

Instance Method Details

#soft_quitObject



78
79
80
# File 'lib/stalk_boss.rb', line 78

def soft_quit
  send_signal('QUIT')
end

#stalk_job(worker, options = {}) {|stalk| ... } ⇒ Object

Yields:

  • (stalk)


67
68
69
70
71
72
# File 'lib/stalk_boss.rb', line 67

def stalk_job(worker, options={}, &block)
  stalk = Stalk.new(worker, options[:workers], options[:log])
  yield(stalk) if block_given?
  stalk_jobs << stalk
  stalk
end

#stalk_jobsObject



63
64
65
# File 'lib/stalk_boss.rb', line 63

def stalk_jobs
  @stalk_jobs ||= []
end

#startObject



82
83
84
# File 'lib/stalk_boss.rb', line 82

def start
  stalk_jobs.each{ |s| s.start }
end

#termObject



74
75
76
# File 'lib/stalk_boss.rb', line 74

def term
  send_signal('INT')
end