add publisher shutdown

This commit is contained in:
chrislu
2023-09-07 23:55:19 -07:00
parent 875f562779
commit 39941edc0b
4 changed files with 22 additions and 5 deletions

View File

@@ -51,6 +51,7 @@ func main() {
// Wait for all publishers to finish
wg.Wait()
elapsed := time.Since(startTime)
publisher.Shutdown()
log.Printf("Published %d messages in %s (%.2f msg/s)", *messageCount, elapsed, float64(*messageCount)/elapsed.Seconds())