Sha256: 1a84a4be79f0769813614844d10e12eb154a94e7d23a32cc30bf9a234850e082

Contents?: true

Size: 850 Bytes

Versions: 98

Compression:

Stored size: 850 Bytes

Contents

module ActivePublisher
  # Publish a message asynchronously to RabbitMQ.
  #
  # Asynchronous is designed to do two things:
  # 1. Introduce the idea of a durable retry should the RabbitMQ connection disconnect.
  # 2. Provide a higher-level pattern for fire-and-forget publishing.
  #
  # @param [String] route The routing key to use for this message.
  # @param [String] payload The message you are sending. Should already be encoded as a string.
  # @param [String] exchange The exchange you want to publish to.
  # @param [Hash] options hash to set message parameters (e.g. headers).
  def self.publish_async(route, payload, exchange_name, options = {})
    ::ActivePublisher::Async.publisher_adapter.publish(route, payload, exchange_name, options)
  end

  module Async
    class << self
      attr_accessor :publisher_adapter
    end
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
active_publisher-1.5.0.pre lib/active_publisher/async.rb
active_publisher-1.4.2-java lib/active_publisher/async.rb
active_publisher-1.4.2 lib/active_publisher/async.rb
active_publisher-1.4.1-java lib/active_publisher/async.rb
active_publisher-1.4.1 lib/active_publisher/async.rb
active_publisher-1.4.1.pre-java lib/active_publisher/async.rb
active_publisher-1.4.1.pre lib/active_publisher/async.rb
active_publisher-1.4.0-java lib/active_publisher/async.rb
active_publisher-1.4.0 lib/active_publisher/async.rb
active_publisher-1.3.2 lib/active_publisher/async.rb
active_publisher-1.3.2-java lib/active_publisher/async.rb
active_publisher-1.3.1-java lib/active_publisher/async.rb
active_publisher-1.3.1 lib/active_publisher/async.rb
active_publisher-1.3.0-java lib/active_publisher/async.rb
active_publisher-1.3.0 lib/active_publisher/async.rb
active_publisher-1.2.6-java lib/active_publisher/async.rb
active_publisher-1.2.6 lib/active_publisher/async.rb
active_publisher-1.2.5-java lib/active_publisher/async.rb
active_publisher-1.2.5 lib/active_publisher/async.rb
active_publisher-1.2.4-java lib/active_publisher/async.rb