Permalink
Browse files

close channel aftr publishing

  • Loading branch information...
1 parent c59fd92 commit c7d34d0b8c2fd30b4fc013afcdb75d0143e28f6f @carlhoerberg carlhoerberg committed Jan 25, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 app.rb
View
7 app.rb
@@ -18,8 +18,9 @@
post '/publish' do
# publish a message to a fanout exchange
AMQP::Channel.new do |channel|
- channel.fanout("f1").publish "Hello, world!"
- channel.close
+ channel.fanout("f1").publish "Hello, world!" do
+ channel.close
+ end
end
204
end
@@ -35,7 +36,7 @@
end
# add a timer to keep the connection alive
- timer = EM.add_periodic_timer(2) { out << ":\n" }
+ timer = EM.add_periodic_timer(20) { out << ":\n" }
# clean up when the user closes the stream
out.callback do

0 comments on commit c7d34d0

Please sign in to comment.