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

Function toggleConsumptionFlow

examples/consumergroup/main.go:151–161  ·  view source on GitHub ↗
(client sarama.ConsumerGroup, isPaused *bool)

Source from the content-addressed store, hash-verified

149}
150
151func toggleConsumptionFlow(client sarama.ConsumerGroup, isPaused *bool) {
152 if *isPaused {
153 client.ResumeAll()
154 log.Println("Resuming consumption")
155 } else {
156 client.PauseAll()
157 log.Println("Pausing consumption")
158 }
159
160 *isPaused = !*isPaused
161}
162
163// Consumer represents a Sarama consumer group consumer
164type Consumer struct {

Callers 1

mainFunction · 0.70

Calls 3

ResumeAllMethod · 0.65
PrintlnMethod · 0.65
PauseAllMethod · 0.65

Tested by

no test coverage detected