Method: Sidekiq::TransactionAwareClient#push

Defined in:
lib/sidekiq/transaction_aware_client.rb

#push(item) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/sidekiq/transaction_aware_client.rb', line 22

def push(item)
  # 6160 we can't support both Sidekiq::Batch and transactions.
  return @redis_client.push(item) if batching?

  # pre-allocate the JID so we can return it immediately and
  # save it to the database as part of the transaction.
  item["jid"] ||= SecureRandom.hex(12)
  @transaction_backend.call { @redis_client.push(item) }
  item["jid"]
end