Sha256: a17411502bdf128d3cfe1cd3757599696697105e4300b4ea37ecf9d2150bae27

Contents?: true

Size: 534 Bytes

Versions: 2

Compression:

Stored size: 534 Bytes

Contents

module EventSourcery
  module Memory
    class Tracker
      def initialize
        @state = Hash.new(0)
      end

      def setup(processor_name)
        @state[processor_name.to_s] = 0
      end

      def processed_event(processor_name, event_id)
        @state[processor_name.to_s] = event_id
      end

      alias :reset_last_processed_event_id :setup

      def last_processed_event_id(processor_name)
        @state[processor_name.to_s]
      end

      def tracked_processors
        @state.keys
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
event_sourcery-0.14.0 lib/event_sourcery/memory/tracker.rb
event_sourcery-0.13.0 lib/event_sourcery/memory/tracker.rb