Class: Karafka::Pro::Routing::Features::Swarm

Inherits:
Base show all
Defined in:
lib/karafka/pro/routing/features/swarm.rb,
lib/karafka/pro/routing/features/swarm/topic.rb,
lib/karafka/pro/routing/features/swarm/config.rb,
lib/karafka/pro/routing/features/swarm/contracts/topic.rb,
lib/karafka/pro/routing/features/swarm/contracts/routing.rb

Overview

Karafka Pro Swarm extensions to the routing They allow for more granular work assignment in the swarm

Defined Under Namespace

Modules: Contracts, Topic Classes: Config

Class Method Summary collapse

Methods inherited from Routing::Features::Base

activate, load_all, post_setup_all, pre_setup_all

Class Method Details

.post_setup(config) ⇒ Object

Binds our routing validation contract prior to warmup in the supervisor, so we can run it when all the context should be there (config + full routing)

Parameters:

  • config (Karafka::Core::Configurable::Node)

    app config



26
27
28
29
30
# File 'lib/karafka/pro/routing/features/swarm.rb', line 26

def post_setup(config)
  config.monitor.subscribe('app.before_warmup') do
    Contracts::Routing.new.validate!(config.internal.routing.builder)
  end
end