public
Rubygem
Description: AMQP client implementation in Ruby/EventMachine
Homepage: http://groups.google.com/group/ruby-amqp
Clone URL: git://github.com/tmm1/amqp.git
fix AMQP.stop
tmm1 (author)
Fri Jul 25 02:00:26 -0700 2008
commit  8b5aba79b02243d23b67b4665cf5a7d95c9bdaf7
tree    29ba0c0ae7cdc5128021141099e4a4a567b9a4e4
parent  5c7cbd8bb410cfdbf0df8f37d03d7ef83f86a4f2
...
22
23
24
25
 
26
27
28
...
22
23
24
 
25
26
27
28
0
@@ -22,7 +22,7 @@ EM.run do
0
   # subscribe to messages from the queue
0
   queue.subscribe do |headers, msg|
0
     pp [:got, headers, msg]
0
- EM.stop_event_loop
0
+ AMQP.stop
0
   end
0
   
0
 end
...
38
39
40
41
 
42
 
43
44
45
...
38
39
40
 
41
42
43
44
45
46
0
@@ -38,8 +38,9 @@ module AMQP
0
           c.close
0
         end
0
       }
0
- @on_stop = on_stop || proc{
0
+ @on_stop = proc{
0
         @conn = nil
0
+ on_stop.call if on_stop
0
         EM.stop_event_loop if stop_reactor
0
       }
0
     end
...
56
57
58
59
60
61
62
...
104
105
106
107
 
 
 
 
 
 
 
 
108
109
110
...
56
57
58
 
59
60
61
...
103
104
105
 
106
107
108
109
110
111
112
113
114
115
116
0
@@ -56,7 +56,6 @@ class MQ
0
                                             :reply_text => 'bye',
0
                                             :method_id => 0,
0
                                             :class_id => 0)
0
-
0
         } if @closing
0
         succeed
0
 
0
@@ -104,7 +103,14 @@ class MQ
0
   end
0
 
0
   def close
0
- @closing = true
0
+ if @deferred_status == :succeeded
0
+ send Protocol::Channel::Close.new(:reply_code => 200,
0
+ :reply_text => 'bye',
0
+ :method_id => 0,
0
+ :class_id => 0)
0
+ else
0
+ @closing = true
0
+ end
0
   end
0
 
0
   # keep track of proxy objects

Comments

    No one has commented yet.