Class: Karafka::Server
- Inherits:
-
Object
- Object
- Karafka::Server
- Defined in:
- lib/karafka/server.rb
Overview
Karafka consuming server class
Class Attribute Summary collapse
-
.consumer_groups ⇒ Array<String>
Array with names of consumer groups that should be consumed in a current server context.
-
.consumer_threads ⇒ Object
Set of consuming threads.
Class Method Summary collapse
-
.run ⇒ Object
Method which runs app.
Class Attribute Details
.consumer_groups ⇒ Array<String>
Returns array with names of consumer groups that should be consumed in a current server context.
35 36 37 38 |
# File 'lib/karafka/server.rb', line 35 def consumer_groups # If not specified, a server will listed on all the topics @consumer_groups ||= Karafka::App.consumer_groups.map(&:name).freeze end |
.consumer_threads ⇒ Object
Set of consuming threads. Each consumer thread contains a single consumer
20 21 22 |
# File 'lib/karafka/server.rb', line 20 def consumer_threads @consumer_threads end |
Class Method Details
.run ⇒ Object
Method which runs app
26 27 28 29 30 31 |
# File 'lib/karafka/server.rb', line 26 def run process.on_sigint { stop_supervised } process.on_sigquit { stop_supervised } process.on_sigterm { stop_supervised } run_supervised end |