Sha256: eb13463e115304c7373a10b66bee091176eca63623a90b174b1dcbc3081d1d5e
Contents?: true
Size: 758 Bytes
Versions: 9
Compression:
Stored size: 758 Bytes
Contents
# frozen_string_literal: true module Karafka module Extensions # Extension for params batch builder for reconstruction of the batch from an array module ParamsBatchBuilder # Builds params batch from array of hashes # @param array [Array<Hash>] array with hash messages # @param topic [Karafka::Routing::Topic] topic for which we build the batch # @return [Karafka::Params::ParamsBatch] built batch # @note We rebuild the params batch from array after the serialization def from_array(array, topic) params_array = array.map do |hash| Karafka::Params::Builders::Params.from_hash(hash, topic) end Karafka::Params::ParamsBatch.new(params_array).freeze end end end end
Version data entries
9 entries across 9 versions & 1 rubygems