Module: Karafka::Pro::Routing::Features::Multiplexing::SubscriptionGroup
- Defined in:
- lib/karafka/pro/routing/features/multiplexing/subscription_group.rb
Overview
Adds methods needed for the multiplexing to work
Instance Method Summary collapse
-
#multiplexing ⇒ Config
Multiplexing config.
-
#multiplexing? ⇒ Boolean
Is multiplexing active.
Instance Method Details
#multiplexing ⇒ Config
Returns multiplexing config.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/karafka/pro/routing/features/multiplexing/subscription_group.rb', line 22 def multiplexing @multiplexing ||= begin max = @details.fetch(:multiplexing_max, 1) min = @details.fetch(:multiplexing_min, max) boot = @details.fetch(:multiplexing_boot, max / 2) active = max > 1 Config.new(active: active, min: min, max: max, boot: boot) end end |
#multiplexing? ⇒ Boolean
Returns is multiplexing active.
34 35 36 |
# File 'lib/karafka/pro/routing/features/multiplexing/subscription_group.rb', line 34 def multiplexing? multiplexing.active? end |