Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Enable heartbeats in the connection loss example

To test that heartbeat sender is properly disabled.

[ci skip]
  • Loading branch information...
commit f0e95af10ceafce378c75d99f18d1d1da553e3ad 1 parent 104eaf1
Michael Klishin authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 examples/error_handling/connection_loss_handler.rb
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.