Sha256: 4ef2ebfb56864afc7a8d5ebacce49cd315e6529e165103266f8c4cdba5932d30

Contents?: true

Size: 453 Bytes

Versions: 8

Compression:

Stored size: 453 Bytes

Contents

module Firehose
  class Publisher
    def publish(path, message)
      channel   = AMQP::Channel.new(Firehose.amqp.connection)
      exchange  = AMQP::Exchange.new(channel, :fanout, path, :auto_delete => true)
      # TODO How do I clean up this exchange at this point? Do I close it somehow or the channel?
      # The exchange just hangs out indefinitely now.
      exchange.publish(message)
      exchange.delete(:if_unused => true)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
firehose-0.0.10 lib/firehose/publisher.rb
firehose-0.0.9 lib/firehose/publisher.rb
firehose-0.0.8 lib/firehose/publisher.rb
firehose-0.0.7 lib/firehose/publisher.rb
firehose-0.0.6 lib/firehose/publisher.rb
firehose-0.0.5 lib/firehose/publisher.rb
firehose-0.0.4 lib/firehose/publisher.rb
firehose-0.0.3 lib/firehose/publisher.rb