Sha256: 693cbc11fac50a9c706d841be326adde2c2016f65b0601c5e847c9cdbb21fc9d
Contents?: true
Size: 890 Bytes
Versions: 1
Compression:
Stored size: 890 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={}) adapter.broker.client.publish(self, body, headers, properties) end def pop_message(options={}) adapter.broker.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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
message-driver-0.4.0 | lib/message_driver/destination.rb |