Sha256: efdf9cf51a16b83cce39e996e594a3faefa49d174afb04ed2c8bfac44cc17834

Contents?: true

Size: 568 Bytes

Versions: 2

Compression:

Stored size: 568 Bytes

Contents

module QueueBus
  # publishes on a delay
  class Publisher

    class << self
      def perform(*args)
        # TODO: move this to just resquebus for fallback
        if args.size > 1
          # handles older arguments
          event_type = args.first
          attributes = args.last
        else
          attributes = args.first
          event_type = attributes["bus_event_type"]
        end
        ::QueueBus.log_worker("Publisher running: #{event_type} - #{attributes.inspect}")
        ::QueueBus.publish(event_type, attributes)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
queue-bus-0.5.2 lib/queue_bus/publisher.rb
queue-bus-0.5.1 lib/queue_bus/publisher.rb