Class: Cosmo::Processor
- Inherits:
-
Object
show all
- Defined in:
- lib/cosmo/processor.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(pool, running, options) ⇒ Processor
Returns a new instance of Processor.
9
10
11
12
13
14
|
# File 'lib/cosmo/processor.rb', line 9
def initialize(pool, running, options)
@pool = pool
@running = running
@options = options
@consumers = []
end
|
Class Method Details
.run ⇒ Object
5
6
7
|
# File 'lib/cosmo/processor.rb', line 5
def self.run(...)
new(...).tap(&:run)
end
|
Instance Method Details
#run ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/cosmo/processor.rb', line 16
def run
setup
return unless @consumers.any?
@running.make_true
run_loop
end
|