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.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/karafka/pro/routing/features/multiplexing/subscription_group.rb', line 39 def multiplexing @multiplexing ||= begin max = @details.fetch(:multiplexing_max, 1) min = @details.fetch(:multiplexing_min, max) boot = @details.fetch(:multiplexing_boot, max / 2) scale_delay = @details.fetch(:multiplexing_scale_delay, 60_000) active = max > 1 Config.new( active: active, min: min, max: max, boot: boot, scale_delay: scale_delay ) end end |
#multiplexing? ⇒ Boolean
Returns is multiplexing active.
58 59 60 |
# File 'lib/karafka/pro/routing/features/multiplexing/subscription_group.rb', line 58 def multiplexing? multiplexing.active? end |