Sha256: f92e8ed20f9b7bbe2a50c111f1937c90cf98b9530206d0017bb26770ee8b0c50

Contents?: true

Size: 412 Bytes

Versions: 113

Compression:

Stored size: 412 Bytes

Contents

#!/usr/bin/env ruby
require 'bunny'

Bundler.setup

begin
  connection = Bunny.new(:automatically_recover => false)
  connection.start

  ch = connection.channel
  x  = ch.default_exchange

  loop do
    10.times do |i|
      print "."
      x.publish("")
    end

    sleep 3.0
  end
rescue Bunny::NetworkFailure => e
  ch.maybe_kill_consumer_work_pool!

  sleep 10
  puts "Recovering manually..."

  retry
end

Version data entries

113 entries across 113 versions & 1 rubygems

Version Path
bunny-2.17.0 examples/connection/manually_reconnecting_publisher.rb
bunny-2.16.1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.15.0 examples/connection/manually_reconnecting_publisher.rb
bunny-2.14.4 examples/connection/manually_reconnecting_publisher.rb
bunny-2.14.3 examples/connection/manually_reconnecting_publisher.rb
bunny-2.14.2 examples/connection/manually_reconnecting_publisher.rb
bunny-2.14.1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.13.0 examples/connection/manually_reconnecting_publisher.rb
bunny-2.12.1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.12.0 examples/connection/manually_reconnecting_publisher.rb
bunny-2.12.0.rc1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.11.0 examples/connection/manually_reconnecting_publisher.rb
bunny-2.11.0.pre1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.10.0 examples/connection/manually_reconnecting_publisher.rb
bunny-2.9.2 examples/connection/manually_reconnecting_publisher.rb
bunny-2.9.1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.6.7 examples/connection/manually_reconnecting_publisher.rb
bunny-2.7.4 examples/connection/manually_reconnecting_publisher.rb
bunny-2.8.1 examples/connection/manually_reconnecting_publisher.rb
bunny-2.9.0 examples/connection/manually_reconnecting_publisher.rb