class Sidekiq::TransactionAwareClient

def initialize(pool: nil, config: nil)

def initialize(pool: nil, config: nil)
  @redis_client = Client.new(pool: pool, config: config)
end

def push(item)

def push(item)
  # 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)
  AfterCommitEverywhere.after_commit { @redis_client.push(item) }
  item["jid"]
end

def push_bulk(items)

a long running enqueue process.
to hold potentially hundreds of thousands of job records in memory due to
We don't provide transactionality for push_bulk because we don't want
#
def push_bulk(items)
  @redis_client.push_bulk(items)
end