Class: Silas::ChannelDeliveryJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/silas/channel_delivery_job.rb

Overview

Outbound delivery, decoupled from the durable loop. Triggered by after_commit callbacks on Turn/ToolInvocation; idempotent via a CAS claim on the marker column (notified_at/answered_at), released if the send raises so a retry can re-attempt. Duplicate pings are the worst failure — never a ledger violation (approve!/decline! are idempotent).

Instance Method Summary collapse

Instance Method Details

#perform(kind, id) ⇒ Object



10
11
12
13
14
15
# File 'app/jobs/silas/channel_delivery_job.rb', line 10

def perform(kind, id)
  case kind
  when "approval" then deliver_approval(id)
  when "answer"   then deliver_answer(id)
  end
end