Sha256: 9415bc0e57f385c5cdd0e011027b6655ef8a46a3ad44dd04c52e66c94f29b2d9
Contents?: true
Size: 594 Bytes
Versions: 19
Compression:
Stored size: 594 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) 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
19 entries across 19 versions & 1 rubygems