Class: KafkaRest::Consumer
- Inherits:
-
Object
- Object
- KafkaRest::Consumer
- Defined in:
- lib/kafka_rest/consumer.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#group_name ⇒ Object
readonly
Returns the value of attribute group_name.
-
#instances ⇒ Object
readonly
Returns the value of attribute instances.
Instance Method Summary collapse
-
#initialize(client, group_name) ⇒ Consumer
constructor
A new instance of Consumer.
- #join {|instance| ... } ⇒ Object
Constructor Details
#initialize(client, group_name) ⇒ Consumer
Returns a new instance of Consumer.
5 6 7 8 9 |
# File 'lib/kafka_rest/consumer.rb', line 5 def initialize(client, group_name) @client = client @group_name = group_name @instances = {} end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/kafka_rest/consumer.rb', line 3 def client @client end |
#group_name ⇒ Object (readonly)
Returns the value of attribute group_name.
3 4 5 |
# File 'lib/kafka_rest/consumer.rb', line 3 def group_name @group_name end |
#instances ⇒ Object (readonly)
Returns the value of attribute instances.
3 4 5 |
# File 'lib/kafka_rest/consumer.rb', line 3 def instances @instances end |
Instance Method Details
#join {|instance| ... } ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/kafka_rest/consumer.rb', line 11 def join res = client.post(consumers_path) instance = ConsumerInstance.new(self, res) @instances[res['instance_id']] = instance yield instance if block_given? instance.start! end |