Module: Promiscuous::Worker
- Defined in:
- lib/promiscuous/worker.rb
Class Method Summary collapse
Class Method Details
.replicate(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/promiscuous/worker.rb', line 5 def self.replicate(={}) publish = [:only].nil? || [:only] == :publish subscribe = [:only].nil? || [:only] == :subscribe self.workers << Promiscuous::Publisher::Worker.new() if publish self.workers << Promiscuous::Subscriber::Worker.new() if subscribe self.workers.each { |w| w.replicate } end |
.stop ⇒ Object
14 15 16 17 |
# File 'lib/promiscuous/worker.rb', line 14 def self.stop self.workers.each { |w| w.stop = true } self.workers.clear end |