Skip to content

Commit

Permalink
Consumer: reduce ticker allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
faceair committed Feb 4, 2018
1 parent 0f4f8ca commit d7428ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,11 @@ func (child *partitionConsumer) HighWaterMarkOffset() int64 {
func (child *partitionConsumer) responseFeeder() {
var msgs []*ConsumerMessage
msgSent := false
expiryTicker := time.NewTicker(child.conf.Consumer.MaxProcessingTime)

feederLoop:
for response := range child.feeder {
msgs, child.responseResult = child.parseResponse(response)
expiryTicker := time.NewTicker(child.conf.Consumer.MaxProcessingTime)

for i, msg := range msgs {
messageSelect:
Expand All @@ -471,10 +471,10 @@ feederLoop:
}
}

expiryTicker.Stop()
child.broker.acks.Done()
}

expiryTicker.Stop()
close(child.messages)
close(child.errors)
}
Expand Down

0 comments on commit d7428ad

Please sign in to comment.