in app/eventgen/generator/generator.go [55:69]
func (g *generator) Run(event publishers.NewMessage, numPublishers int, timeout time.Duration) {
log.Printf("run event generator with numPublishers: %v, timeout: %v", numPublishers, timeout)
ctx, cancel := context.WithCancel(context.Background())
g.cancel = cancel
pbrs := publishers.NewPublishers(g.topic, event, timeout)
pbrs.Add(ctx, numPublishers)
g.publishers = pbrs
// Wait for all publishers to finish and then release the resources in another thread
go func() {
pbrs.WaitFinish()
g.release()
}()
}