Module: Karafka::Pro::Routing::Features::Multiplexing::SubscriptionGroupsBuilder
- Defined in:
- lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb
Overview
Expands the builder to multiply multiplexed groups
Instance Method Summary collapse
-
#expand(topics_array) ⇒ Array<Array<Routing::Topics>>
Takes into consideration multiplexing and builds the more groups.
Instance Method Details
#expand(topics_array) ⇒ Array<Array<Routing::Topics>>
Takes into consideration multiplexing and builds the more groups
26 27 28 29 30 31 32 33 34 |
# File 'lib/karafka/pro/routing/features/multiplexing/subscription_groups_builder.rb', line 26 def (topics_array) factor = topics_array.first.subscription_group_details.fetch(:multiplexing_max, 1) Array.new(factor) do |i| ::Karafka::Routing::Topics.new( i.zero? ? topics_array : topics_array.map(&:dup) ) end end |