Class: Primer::Worker::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/primer/worker.rb

Direct Known Subclasses

ActiveRecordAgent, ChangesAgent

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run!Object



7
8
9
10
11
# File 'lib/primer/worker.rb', line 7

def self.run!
  agent = new
  agent.run!
  agent
end

.topic(topic_name = nil) ⇒ Object



13
14
15
# File 'lib/primer/worker.rb', line 13

def self.topic(topic_name = nil)
  @topic_name ||= topic_name
end

Instance Method Details

#run!Object



17
18
19
# File 'lib/primer/worker.rb', line 17

def run!
  Primer.bus.subscribe(self.class.topic) { |m| on_message(m) }
end