Sha256: d40f557ce297c0f6090cf5923944ab52b016b45a523525d34d54a4e1c8233302

Contents?: true

Size: 481 Bytes

Versions: 26

Compression:

Stored size: 481 Bytes

Contents

module Euston
  module EventStore
    module Dispatcher
      class SynchronousDispatcher
        def initialize persistence, &block
          @persistence = persistence
          @dispatch = block
        end

        def dispatch commit
          @dispatch.call commit
          @persistence.mark_commit_as_dispatched commit
        end

        def lookup
          @persistence.get_undispatched_commits.each { |commit| dispatch commit }
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
euston-eventstore-1.2.7 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.7-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.6 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.6-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.5-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.5 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.4 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.4-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.3 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.3-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.2 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.2-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.1-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.1 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.0 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.2.0-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.1.0 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.1.0-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.0.4-java lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb
euston-eventstore-1.0.4 lib/euston-eventstore/dispatcher/synchronous_dispatcher.rb