Wait for Kafka partition to shutdown
This commit is contained in:
@@ -19,7 +19,7 @@ func (n *NumberPrinter) Startup() {
|
||||
log.Printf("Oh, crap! There was a panic, take a look: %v", err)
|
||||
})
|
||||
|
||||
n.LimitRate(1, 2*time.Second)
|
||||
n.LimitRate(3, 1*time.Second)
|
||||
n.SystemProcess("Random Number Generator", n.generateNumbers)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ type PriceUpdate struct {
|
||||
|
||||
// Startup creates a new subscription for ProductPriceUpdates topic.
|
||||
func (p *PriceConsumer) Startup() {
|
||||
p.LimitRate(1, 500*time.Millisecond)
|
||||
b.Subscribe("ProductPriceUpdates", func(u PriceUpdate) {
|
||||
log.Printf("Price for %q is now $%.2f", u.Product, u.Amount)
|
||||
})
|
||||
p.LimitRate(5, 1*time.Second)
|
||||
}
|
||||
|
||||
// Shutdown is empty because PriceConsumer requires no cleanup upon exiting.
|
||||
|
||||
Reference in New Issue
Block a user