Skip to content

Commit 646ddb5

Browse files
Ruby: correct await per message in the first example in tutorial 7
1 parent 0a97dfe commit 646ddb5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ruby/publisher_confirms.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ def publish_messages_individually(connection)
1313
MESSAGE_COUNT.times do |i|
1414
body = i.to_s
1515
channel.basic_publish(body, '', queue.name)
16+
channel.wait_for_confirms
1617
end
1718

18-
# Wait for any remaining confirmations
19-
channel.wait_for_confirms
2019
end_time = Time.now
2120

2221
puts "Published #{MESSAGE_COUNT} messages individually in #{((end_time - start_time) * 1000).to_i} ms"

0 commit comments

Comments
 (0)