Class: Maxwell::Agent::Runner
- Inherits:
-
Celluloid::SupervisionGroup
- Object
- Celluloid::SupervisionGroup
- Maxwell::Agent::Runner
- Defined in:
- lib/maxwell/agent/runner.rb
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Class Method Summary collapse
Instance Method Summary collapse
- #[](actor_name) ⇒ Object
-
#initialize(opts) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(opts) ⇒ Runner
Returns a new instance of Runner.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/maxwell/agent/runner.rb', line 18 def initialize(opts) super pool Agent::MiddlewareRunner, size: self.class.worker_pool_size supervise_as :work_schedule, Agent::WorkSchedule pool Agent::StandardWorker, as: :worker, size: self.class.worker_pool_size supervise_as :evented_worker, Agent::EventedWorker supervise_as :scheduler, Agent::Scheduler, work_schedule: self[:work_schedule], worker: self[:worker], evented_worker: self[:evented_worker] self[:scheduler].async.run end |
Instance Attribute Details
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
12 13 14 |
# File 'lib/maxwell/agent/runner.rb', line 12 def registry @registry end |
Class Method Details
.worker_pool_size ⇒ Object
14 15 16 |
# File 'lib/maxwell/agent/runner.rb', line 14 def self.worker_pool_size Agent.configuration.worker_concurrency end |
Instance Method Details
#[](actor_name) ⇒ Object
35 36 37 |
# File 'lib/maxwell/agent/runner.rb', line 35 def [](actor_name) @registry[actor_name] end |