Class: Protege::Loop::Scheduler
- Inherits:
-
Object
- Object
- Protege::Loop::Scheduler
- Defined in:
- lib/protege/loop/scheduler.rb
Overview
The dispatch coordinator behind the Loop layer's every-minute clock. Each tick it finds the
responsibilities due this minute and tells each to dispatch itself; it owns which responsibilities
fire, while Responsibility#dispatch! owns how (recording a run, enqueuing the job).
Intentionally minimal: no overlap guard, no concurrency cap, no stale recovery, no minute-dedup. The recurring tick fires once per minute and the queue adapter bounds parallelism; a failed run is recorded and simply waits for its next scheduled minute.
Class Method Summary collapse
-
.dispatch ⇒ void
Dispatch every responsibility due now.
Instance Method Summary collapse
-
#dispatch ⇒ void
Tell each active, due responsibility to dispatch itself.
Class Method Details
.dispatch ⇒ void
This method returns an undefined value.
Dispatch every responsibility due now.
17 18 19 |
# File 'lib/protege/loop/scheduler.rb', line 17 def dispatch new.dispatch end |
Instance Method Details
#dispatch ⇒ void
This method returns an undefined value.
Tell each active, due responsibility to dispatch itself.
25 26 27 28 29 |
# File 'lib/protege/loop/scheduler.rb', line 25 def dispatch Protege::Responsibility.active.with_active_persona.find_each do |responsibility| responsibility.dispatch! if responsibility.due?(now) end end |