Class: Karafka::Connection::Listener
- Inherits:
-
Object
- Object
- Karafka::Connection::Listener
- Defined in:
- lib/karafka/connection/listener.rb
Overview
Note:
It does not loop on itself - it needs to be executed in a loop
Note:
Listener itself does nothing with the message - it will return to the block a raw Kafka::FetchedMessage
A single listener that listens to incoming messages from a single route
Instance Method Summary collapse
-
#call ⇒ Object
Runs prefetch callbacks and executes the main listener fetch loop.
-
#initialize(consumer_group) ⇒ Karafka::Connection::Listener
constructor
Listener instance.
Constructor Details
#initialize(consumer_group) ⇒ Karafka::Connection::Listener
Returns listener instance.
13 14 15 |
# File 'lib/karafka/connection/listener.rb', line 13 def initialize(consumer_group) @consumer_group = consumer_group end |
Instance Method Details
#call ⇒ Object
Runs prefetch callbacks and executes the main listener fetch loop
18 19 20 21 22 23 24 25 |
# File 'lib/karafka/connection/listener.rb', line 18 def call Karafka.monitor.instrument( 'connection.listener.before_fetch_loop', consumer_group: @consumer_group, client: client ) fetch_loop end |