Class: MaquinaNewsletters::Scheduler

Inherits:
Object
  • Object
show all
Defined in:
app/services/maquina_newsletters/scheduler.rb

Overview

Public entry point for kicking off a newsletter’s send. A single path serves both immediate sends and future-scheduled sends, and both batch_size 0 and >0: it enqueues exactly one SendBatchJob (batch 0), which owns the scheduled → sending transition and recipients_count (Sidecar A1/A3/A4). There is no MarkSentIfCompleteJob (Pattern A cancelled, Sidecar A4).

The scheduling itself lives on the rich model (Newsletter#enqueue_send); this thin wrapper preserves the Scheduler.call(newsletter) call site.

Class Method Summary collapse

Class Method Details

.call(newsletter) ⇒ Object



13
14
15
# File 'app/services/maquina_newsletters/scheduler.rb', line 13

def self.call(newsletter)
  newsletter.enqueue_send
end