Class: Sidekiq::ReliableJob::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/reliable_job/client.rb

Overview

Stages jobs to the Outbox for later delivery to Redis.

Class Method Summary collapse

Class Method Details

.push(item) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sidekiq/reliable_job/client.rb', line 10

def push(item)
  item["jid"] ||= SecureRandom.hex(12)

  Outbox.create!(
    jid: item["jid"],
    job_class: extract_job_class(item),
    payload: item,
    status: Outbox::PENDING,
  )

  item["jid"]
end