Module: Karafka::Extensions::ParamsBatchBuilder
- Defined in:
- lib/karafka/extensions/params_batch_builder.rb
Overview
Extension for params batch builder for reconstruction of the batch from an array
Instance Method Summary collapse
-
#from_array(array, topic) ⇒ Karafka::Params::ParamsBatch
Builds params batch from array of hashes.
Instance Method Details
#from_array(array, topic) ⇒ Karafka::Params::ParamsBatch
Note:
We rebuild the params batch from array after the serialization
Builds params batch from array of hashes
12 13 14 15 16 17 18 |
# File 'lib/karafka/extensions/params_batch_builder.rb', line 12 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 |