Permalink
Browse files

Enable heartbeats in the connection loss example

To test that heartbeat sender is properly disabled.

[ci skip]
  • Loading branch information...
Michael Klishin
Michael Klishin committed Feb 20, 2013
1 parent 104eaf1 commit f0e95af10ceafce378c75d99f18d1d1da553e3ad
Showing with 3 additions and 2 deletions.
  1. +3 −2 examples/error_handling/connection_loss_handler.rb
@@ -15,7 +15,8 @@
:vhost => "amq_client_testbed",
:user => "amq_client_gem",
:password => "amq_client_gem_password",
- :timeout => 0.3,
+ :timeout => 0.3,
+ :heartbeat => 1.0,
:on_tcp_connection_failure => Proc.new { |settings| puts "Failed to connect, this was NOT expected"; EM.stop }) do |connection, open_ok|
connection.on_tcp_connection_loss do |cl, settings|
puts "tcp_connection_loss handler kicks in"
@@ -31,5 +32,5 @@
puts "Connected, authenticated. To really exercise this example, shut RabbitMQ down for a few seconds. If you don't it will exit gracefully in 30 seconds."
Signal.trap "INT", show_stopper
- EM.add_timer(30, show_stopper)
+ EM.add_timer(60, show_stopper)
end

0 comments on commit f0e95af

Please sign in to comment.