amq-client 0.8.7.pre1 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -211,7 +211,10 @@ module AMQ
211
211
  # @see #close_connection
212
212
  def disconnect(reply_code = 200, reply_text = "Goodbye", class_id = 0, method_id = 0, &block)
213
213
  @intentionally_closing_connection = true
214
- self.on_disconnection(&block)
214
+ self.on_disconnection do
215
+ @frames.clear
216
+ block.call if block
217
+ end
215
218
 
216
219
  # ruby-amqp/amqp#66, MK.
217
220
  if self.open?
@@ -515,7 +518,7 @@ module AMQ
515
518
  if frameset_complete?(@frames[frame.channel])
516
519
  receive_frameset(@frames[frame.channel])
517
520
  # for channel.close, frame.channel will be nil. MK.
518
- @frames[frame.channel].clear if @frames[frame.channel]
521
+ clear_frames_on(frame.channel) if @frames[frame.channel]
519
522
  end
520
523
  end
521
524
 
@@ -540,6 +543,15 @@ module AMQ
540
543
  end
541
544
  end
542
545
 
546
+ # Clears frames that were received but not processed on given channel. Needs to be called
547
+ # when the channel is closed.
548
+ # @private
549
+ def clear_frames_on(channel_id)
550
+ raise ArgumentError, "channel id cannot be nil!" if channel_id.nil?
551
+
552
+ @frames[channel_id].clear
553
+ end
554
+
543
555
  # Sends a heartbeat frame if connection is open.
544
556
  # @api plugin
545
557
  def send_heartbeat
@@ -611,7 +623,6 @@ module AMQ
611
623
  # @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.5.2.9)
612
624
  def handle_close(conn_close)
613
625
  closed!
614
- # TODO: use proper exception class, provide protocol class (we know conn_close.class_id and conn_close.method_id) as well!
615
626
  self.exec_callback_yielding_self(:error, conn_close)
616
627
  end
617
628
 
@@ -404,6 +404,7 @@ module AMQ
404
404
  # @private
405
405
  def handle_close_ok(close_ok)
406
406
  self.status = :closed
407
+ self.connection.clear_frames_on(self.id)
407
408
  self.exec_callback_once_yielding_self(:close, close_ok)
408
409
  end
409
410
 
@@ -411,6 +412,7 @@ module AMQ
411
412
  # @private
412
413
  def handle_close(channel_close)
413
414
  self.status = :closed
415
+ self.connection.clear_frames_on(self.id)
414
416
  self.exec_callback_yielding_self(:error, channel_close)
415
417
 
416
418
  self.handle_connection_interruption(channel_close)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AMQ
4
4
  module Client
5
- VERSION = "0.8.7.pre1"
5
+ VERSION = "0.8.7"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amq-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1923831827
5
- prerelease: 6
4
+ hash: 49
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
9
  - 7
10
- - pre
11
- - 1
12
- version: 0.8.7.pre1
10
+ version: 0.8.7
13
11
  platform: ruby
14
12
  authors:
15
13
  - Jakub Stastny
@@ -20,7 +18,7 @@ autorequire:
20
18
  bindir: bin
21
19
  cert_chain: []
22
20
 
23
- date: 2011-11-13 00:00:00 Z
21
+ date: 2011-12-04 00:00:00 Z
24
22
  dependencies:
25
23
  - !ruby/object:Gem::Dependency
26
24
  name: eventmachine
@@ -242,14 +240,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
240
  required_rubygems_version: !ruby/object:Gem::Requirement
243
241
  none: false
244
242
  requirements:
245
- - - ">"
243
+ - - ">="
246
244
  - !ruby/object:Gem::Version
247
- hash: 25
245
+ hash: 3
248
246
  segments:
249
- - 1
250
- - 3
251
- - 1
252
- version: 1.3.1
247
+ - 0
248
+ version: "0"
253
249
  requirements: []
254
250
 
255
251
  rubyforge_project: amq-client