Class: Coil::Outbox::Message

Inherits:
ApplicationRecord show all
Includes:
TransactionalMessage
Defined in:
app/models/coil/outbox/message.rb

Constant Summary collapse

PERSISTENCE_QUEUE =
"OUTBOX_PERSISTENCE_QUEUE"
PROCESS_QUEUE =
"OUTBOX_PROCESS_QUEUE"
COMPLETION =
::Coil::Outbox::Completion

Instance Method Summary collapse

Methods included from TransactionalMessage

#locking_persistence_queue, #processed, #processed?, #unprocessed_predecessors

Instance Method Details

#enqueue_job(processor_name = job_class.to_s) ⇒ Object



16
17
18
# File 'app/models/coil/outbox/message.rb', line 16

def enqueue_job(processor_name = job_class.to_s)
  perform_job_in(0.seconds, processor_name)
end

#job_classObject



24
25
# File 'app/models/coil/outbox/message.rb', line 24

def job_class
end

#perform_job_in(interval, processor_name = job_class.to_s) ⇒ Object



20
21
22
# File 'app/models/coil/outbox/message.rb', line 20

def perform_job_in(interval, processor_name = job_class.to_s)
  job_class.perform_in(interval, key, processor_name)
end