Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

close channel aftr publishing

  • Loading branch information...
commit c7d34d0b8c2fd30b4fc013afcdb75d0143e28f6f 1 parent c59fd92
Carl Hörberg authored January 25, 2013

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  app.rb
7  app.rb
@@ -18,8 +18,9 @@
18 18
 post '/publish' do
19 19
   # publish a message to a fanout exchange
20 20
   AMQP::Channel.new do |channel|
21  
-    channel.fanout("f1").publish "Hello, world!"
22  
-    channel.close
  21
+    channel.fanout("f1").publish "Hello, world!" do
  22
+      channel.close
  23
+    end
23 24
   end
24 25
   204
25 26
 end
@@ -35,7 +36,7 @@
35 36
       end
36 37
 
37 38
       # add a timer to keep the connection alive 
38  
-      timer = EM.add_periodic_timer(2) { out << ":\n" } 
  39
+      timer = EM.add_periodic_timer(20) { out << ":\n" } 
39 40
       
40 41
       # clean up when the user closes the stream
41 42
       out.callback do

0 notes on commit c7d34d0

Please sign in to comment.
Something went wrong with that request. Please try again.