Sha256: 79890c196afc691ef9568ccf015bd058ba13f9e086bc472ebf626fd2ea5683ce
Contents?: true
Size: 601 Bytes
Versions: 13
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true require "sidekiq" module SidekiqPublisher class Client < Sidekiq::Client def bulk_push(items) payloads = items.map do |item| normed = normalize_item(item) process_single(item["class"], normed) || nil end.compact pushed = 0 with_connection do |conn| conn.multi do payloads.each do |payload| atomic_push(conn, [payload]) pushed += 1 end end end pushed end private def with_connection(&blk) @redis_pool.with(&blk) end end end
Version data entries
13 entries across 13 versions & 1 rubygems