Class: Karafka::Pro::Connection::Multiplexing::Listener

Inherits:
Object
  • Object
show all
Defined in:
lib/karafka/pro/connection/multiplexing/listener.rb

Overview

Listener used to connect listeners manager to the lifecycle events that are significant to its operations

Instance Method Summary collapse

Constructor Details

#initializeListener

Returns a new instance of Listener.



23
24
25
# File 'lib/karafka/pro/connection/multiplexing/listener.rb', line 23

def initialize
  @manager = App.config.internal.connection.manager
end

Instance Method Details

#on_statistics_emitted(event) ⇒ Object

Triggers connection manage subscription groups details noticing

Parameters:

  • event (Karafka::Core::Monitoring::Event)

    event with statistics



30
31
32
33
34
35
# File 'lib/karafka/pro/connection/multiplexing/listener.rb', line 30

def on_statistics_emitted(event)
  @manager.notice(
    event[:subscription_group_id],
    event[:statistics]
  )
end