Skip to content

Commit a94669d

Browse files
committed
Gracefully shut down the example on interrupt
1 parent 835514b commit a94669d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/consumer-group.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
consumer.subscribe(topic)
2121

2222
trap("TERM") { consumer.stop }
23+
trap("INT") { consumer.stop }
2324

2425
consumer.each_message do |message|
2526
puts message.value

0 commit comments

Comments
 (0)