Class: Racecar::Consumer
- Inherits:
-
Object
- Object
- Racecar::Consumer
- Defined in:
- lib/racecar/consumer.rb
Defined Under Namespace
Classes: Subscription
Class Attribute Summary collapse
-
.group_id ⇒ Object
Returns the value of attribute group_id.
-
.max_wait_time ⇒ Object
Returns the value of attribute max_wait_time.
-
.offset_retention_time ⇒ Object
Returns the value of attribute offset_retention_time.
Class Method Summary collapse
-
.subscribes_to(*topics, start_from_beginning: true, max_bytes_per_partition: 1048576) ⇒ nil
Adds one or more topic subscriptions.
- .subscriptions ⇒ Object
Instance Method Summary collapse
Class Attribute Details
.group_id ⇒ Object
Returns the value of attribute group_id.
7 8 9 |
# File 'lib/racecar/consumer.rb', line 7 def group_id @group_id end |
.max_wait_time ⇒ Object
Returns the value of attribute max_wait_time.
6 7 8 |
# File 'lib/racecar/consumer.rb', line 6 def max_wait_time @max_wait_time end |
.offset_retention_time ⇒ Object
Returns the value of attribute offset_retention_time.
8 9 10 |
# File 'lib/racecar/consumer.rb', line 8 def offset_retention_time @offset_retention_time end |
Class Method Details
.subscribes_to(*topics, start_from_beginning: true, max_bytes_per_partition: 1048576) ⇒ nil
Adds one or more topic subscriptions.
Can be called multiple times in order to subscribe to more topics.
24 25 26 27 28 |
# File 'lib/racecar/consumer.rb', line 24 def subscribes_to(*topics, start_from_beginning: true, max_bytes_per_partition: 1048576) topics.each do |topic| subscriptions << Subscription.new(topic, start_from_beginning, max_bytes_per_partition) end end |
.subscriptions ⇒ Object
10 11 12 |
# File 'lib/racecar/consumer.rb', line 10 def subscriptions @subscriptions ||= [] end |
Instance Method Details
#configure(consumer:, producer:) ⇒ Object
31 32 33 34 |
# File 'lib/racecar/consumer.rb', line 31 def configure(consumer:, producer:) @_consumer = consumer @_producer = producer end |
#teardown ⇒ Object
36 |
# File 'lib/racecar/consumer.rb', line 36 def teardown; end |