Sha256: 958a59bf1bb7a8bfc3eebc04f3d7e86a7aa3fca5d3cea937cf24b48b09475c12

Contents?: true

Size: 858 Bytes

Versions: 5

Compression:

Stored size: 858 Bytes

Contents

module MessageDriver
  module Destination
    class Base
      attr_reader :adapter, :name, :dest_options, :message_props

      def initialize(adapter, name, dest_options, message_props)
        @adapter = adapter
        @name = name
        @dest_options = dest_options
        @message_props = message_props
      end

      def publish(body, headers={}, properties={})
        Client.publish(self, body, headers, properties)
      end

      def pop_message(options={})
        Client.pop_message(self, options)
      end

      def after_initialize(adapter_context)
        #does nothing, feel free to override as needed
      end

      def message_count
        raise "#message_count is not supported by #{self.class}"
      end

      def subscribe(&consumer)
        raise "#subscribe is not supported by #{self.class}"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
message-driver-0.2.2 lib/message_driver/destination.rb
message-driver-0.2.1 lib/message_driver/destination.rb
message-driver-0.2.0 lib/message_driver/destination.rb
message-driver-0.2.0.rc2 lib/message_driver/destination.rb
message-driver-0.2.0.rc1 lib/message_driver/destination.rb