lib/stomper/extensions/heartbeat.rb in stomper-2.0.4 vs lib/stomper/extensions/heartbeat.rb in stomper-2.0.5

- old
+ new

@@ -75,21 +75,21 @@ # @see #heartbeat_client_limit # @see #broker_alive? def client_alive? # Consider some benchmarking to determine if this is faster than # re-writing the method after its first invocation. - heartbeat_client_limit == 0 || + @connecting || heartbeat_client_limit == 0 || duration_since_transmitted <= heartbeat_client_limit end # Returns true if the broker is alive. Broker is alive if broker heartbeating # is disabled, or the number of milliseconds that have passed since last # receiving is less than or equal to {#heartbeat_broker_limit broker} limit # @return [true,false] # @see #heartbeat_broker_limit # @see #client_alive? def broker_alive? - heartbeat_broker_limit == 0 || + @connecting || heartbeat_broker_limit == 0 || duration_since_received <= heartbeat_broker_limit end end # A mapping between protocol versions and modules to include