Sha256: 4f4d766bbf30c1932349105ccd9ecc97ea2f072a79602ac067f16562486b711b

Contents?: true

Size: 439 Bytes

Versions: 23

Compression:

Stored size: 439 Bytes

Contents

module Eventus
  module Dispatchers
    class Synchronous
      attr_accessor :action

      def initialize(persistence, &block)
        @persistence = persistence
        @action = block || lambda {}
      end

      def dispatch(events)
        Eventus.logger.info "Dispatching #{events.length} events"
        events.each do |e|
          @action.call(e)
          @persistence.mark_dispatched e
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
eventus-0.6.7 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.6 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.5 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.4 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.3 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.2 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.1 lib/eventus/dispatchers/synchronous.rb
eventus-0.6.0 lib/eventus/dispatchers/synchronous.rb
eventus-0.5.1 lib/eventus/dispatchers/synchronous.rb
eventus-0.5.0 lib/eventus/dispatchers/synchronous.rb
eventus-0.4.3 lib/eventus/dispatchers/synchronous.rb
eventus-0.4.2 lib/eventus/dispatchers/synchronous.rb
eventus-0.4.1 lib/eventus/dispatchers/synchronous.rb
eventus-0.4.0 lib/eventus/dispatchers/synchronous.rb
eventus-0.3.9 lib/eventus/dispatchers/synchronous.rb
eventus-0.3.8 lib/eventus/dispatchers/synchronous.rb
eventus-0.3.7 lib/eventus/dispatchers/synchronous.rb
eventus-0.3.6 lib/eventus/dispatchers/synchronous.rb
eventus-0.3.5 lib/eventus/dispatchers/synchronous.rb
eventus-0.3.4 lib/eventus/dispatchers/synchronous.rb