Class: GitMQueue::Consumer
- Inherits:
-
Object
- Object
- GitMQueue::Consumer
- Defined in:
- lib/consumer.rb
Instance Method Summary collapse
- #branch_file ⇒ Object
- #consume(&block) ⇒ Object
-
#initialize(storage:, name:, branch:) ⇒ Consumer
constructor
A new instance of Consumer.
- #stop ⇒ Object
Constructor Details
#initialize(storage:, name:, branch:) ⇒ Consumer
Returns a new instance of Consumer.
7 8 9 10 11 |
# File 'lib/consumer.rb', line 7 def initialize(storage:, name:, branch:) @storage = storage @branch = branch @name = name end |
Instance Method Details
#branch_file ⇒ Object
13 14 15 |
# File 'lib/consumer.rb', line 13 def branch_file @branch_file ||= File.join(@storage.path, 'refs', 'heads') end |
#consume(&block) ⇒ Object
17 18 19 20 21 |
# File 'lib/consumer.rb', line 17 def consume(&block) @block = block consume_commits listener.start end |
#stop ⇒ Object
23 24 25 |
# File 'lib/consumer.rb', line 23 def stop listener.stop end |