MCPcopy
hub / github.com/IBM/sarama / newConsumer

Function newConsumer

consumer.go:129–144  ·  view source on GitHub ↗
(client Client)

Source from the content-addressed store, hash-verified

127}
128
129func newConsumer(client Client) (Consumer, error) {
130 // Check that we are not dealing with a closed Client before processing any other arguments
131 if client.Closed() {
132 return nil, ErrClosedClient
133 }
134
135 c := &consumer{
136 client: client,
137 conf: client.Config(),
138 children: make(map[string]map[int32]*partitionConsumer),
139 brokerConsumers: make(map[*Broker]*brokerConsumer),
140 metricRegistry: newCleanupRegistry(client.Config().MetricRegistry),
141 }
142
143 return c, nil
144}
145
146func (c *consumer) Close() error {
147 c.metricRegistry.UnregisterAll()

Callers 3

NewConsumerFunction · 0.85
NewConsumerFromClientFunction · 0.85
newConsumerGroupFunction · 0.85

Calls 3

newCleanupRegistryFunction · 0.85
ClosedMethod · 0.65
ConfigMethod · 0.65

Tested by

no test coverage detected