Class: Periodico
- Inherits:
-
Object
- Object
- Periodico
- Defined in:
- lib/periodico.rb,
lib/periodico/version.rb,
lib/periodico/executor.rb,
lib/periodico/subscriber.rb
Defined Under Namespace
Classes: Executor, Subscriber
Constant Summary collapse
- DEFAULT_WORKER_POOL_SIZE =
5
- VERSION =
"0.1.3"
Instance Attribute Summary collapse
-
#worker_pool_size ⇒ Object
readonly
Returns the value of attribute worker_pool_size.
Instance Method Summary collapse
-
#initialize(worker_pool_size: DEFAULT_WORKER_POOL_SIZE) ⇒ Periodico
constructor
A new instance of Periodico.
- #publish(message:, params:) ⇒ Object
Constructor Details
#initialize(worker_pool_size: DEFAULT_WORKER_POOL_SIZE) ⇒ Periodico
Returns a new instance of Periodico.
12 13 14 |
# File 'lib/periodico.rb', line 12 def initialize(worker_pool_size: DEFAULT_WORKER_POOL_SIZE) @worker_pool_size = worker_pool_size end |
Instance Attribute Details
#worker_pool_size ⇒ Object (readonly)
Returns the value of attribute worker_pool_size.
10 11 12 |
# File 'lib/periodico.rb', line 10 def worker_pool_size @worker_pool_size end |
Instance Method Details
#publish(message:, params:) ⇒ Object
16 17 18 19 20 |
# File 'lib/periodico.rb', line 16 def publish(message:, params:) executor.execute do Manufacturable.build_all(Subscriber, , **params).each(&:receive) end end |