Module: Julewire::Karafka::ForkHooks
- Defined in:
- lib/julewire/karafka/fork_hooks.rb
Class Method Summary collapse
Class Method Details
.handle(event_name, _event) ⇒ Object
28 29 30 31 32 |
# File 'lib/julewire/karafka/fork_hooks.rb', line 28 def handle(event_name, _event) IntegrationHealth.with_failure_health(action: :after_fork, component: :fork_hooks, event: event_name) do Julewire.after_fork! end end |
.subscribe!(monitor, configuration:) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/julewire/karafka/fork_hooks.rb', line 14 def subscribe!(monitor, configuration:) return unless configuration.enabled? return unless monitor.respond_to?(:subscribe) state = INSTALL_STATE.fetch_or_store(monitor) { { events: [] } } subscribed_events = state.fetch(:events) EVENTS.each do |event_name| next if subscribed_events.include?(event_name) subscribed_events << event_name if subscribe_event(monitor, event_name) end monitor end |