module Sidekiq
module Worker
module Bulk
def perform_async_bulk(args_set)
bulk_size = get_sidekiq_options['max_bulk_size'] || 1000
args_set.each_slice(bulk_size).flat_map do |args|
client_push_bulk('class' => self, 'args' => args)
end
end
def client_push_bulk(item)
pool = Thread.current[:sidekiq_via_pool] ||
get_sidekiq_options['pool'] || Sidekiq.redis_pool
Sidekiq::Client.new(pool).push_bulk(item.stringify_keys)
end
end
end
end