amq-client 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/amq-client.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # Dependencies
22
22
  s.add_dependency "eventmachine"
23
- s.add_dependency "amq-protocol", ">= 0.9.1"
23
+ s.add_dependency "amq-protocol", ">= 0.9.4"
24
24
 
25
25
 
26
26
  # RubyForge
@@ -277,6 +277,12 @@ module AMQ
277
277
  @settings[:heartbeat] || @settings[:heartbeat_interval] || 0
278
278
  end # heartbeat_interval
279
279
 
280
+ # Returns true if heartbeats are enabled (heartbeat interval is greater than 0)
281
+ # @return [Boolean]
282
+ def heartbeats_enabled?
283
+ self.heartbeat_interval > 0
284
+ end
285
+
280
286
 
281
287
  # vhost this connection uses. Default is "/", a historically estabilished convention
282
288
  # of RabbitMQ and amqp gem.
@@ -529,10 +535,16 @@ module AMQ
529
535
  # @param [Array<AMQ::Protocol::Frame>] frames
530
536
  # @api plugin
531
537
  def receive_frameset(frames)
538
+ if self.heartbeats_enabled?
539
+ # treat incoming traffic as heartbeats.
540
+ # this operation is pretty expensive under heavy traffic but heartbeats can be disabled
541
+ # (and are also disabled by default). MK.
542
+ @last_server_heartbeat = Time.now
543
+ end
532
544
  frame = frames.first
533
545
 
534
- if Protocol::HeartbeatFrame === frame
535
- @last_server_heartbeat = Time.now
546
+ if AMQ::Protocol::HeartbeatFrame === frame
547
+ # no-op
536
548
  else
537
549
  if callable = AMQ::Client::HandlersRegistry.find(frame.method_class)
538
550
  f = frames.shift
@@ -173,9 +173,7 @@ module AMQ
173
173
  self.reset
174
174
  self.set_pending_connect_timeout((@settings[:timeout] || 3).to_f) unless defined?(JRUBY_VERSION)
175
175
 
176
- if self.heartbeat_interval > 0
177
- self.initialize_heartbeat_sender
178
- end
176
+ self.initialize_heartbeat_sender if self.heartbeats_enabled?
179
177
  end # initialize(*args)
180
178
 
181
179
 
@@ -40,7 +40,8 @@ module AMQ
40
40
  # if you want to load broker-specific extensions
41
41
  :broker => nil,
42
42
 
43
- :frame_max => 131072
43
+ :frame_max => 131072,
44
+ :heartbeat => 0
44
45
  }
45
46
  end
46
47
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AMQ
4
4
  module Client
5
- VERSION = "0.9.3"
5
+ VERSION = "0.9.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amq-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 3
10
- version: 0.9.3
9
+ - 4
10
+ version: 0.9.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jakub Stastny
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-06-22 00:00:00 Z
21
+ date: 2012-07-05 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: eventmachine
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 57
45
+ hash: 51
46
46
  segments:
47
47
  - 0
48
48
  - 9
49
- - 1
50
- version: 0.9.1
49
+ - 4
50
+ version: 0.9.4
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  description: amq-client is a fully-featured, low-level AMQP 0.9.1 client with pluggable networking I/O adapters (EventMachine, cool.io, Eventpanda and so on) and supposed to back more opinionated AMQP clients (such as amqp gem) or be used directly in cases when access to more advanced AMQP 0.9.1 features is more important that convenient APIs
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  requirements: []
250
250
 
251
251
  rubyforge_project: amq-client
252
- rubygems_version: 1.8.15
252
+ rubygems_version: 1.8.24
253
253
  signing_key:
254
254
  specification_version: 3
255
255
  summary: amq-client is a fully-featured, low-level AMQP 0.9.1 client