Sha256: 5f1be1ff47da4362204aa6c01956782276f73050213b7f0a85a8f949cb10653b

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

module Aggro
  class FileStore
    # Private: Deserialized events from an IO object.
    class Reader
      def initialize(data_io, index_io)
        @data_io = data_io
        @index_io = index_io
      end

      def read
        Enumerator.new do |yielder|
          stream.each do |raw_event|
            yielder << EventSerializer.deserialize(raw_event)
          end
        end
      end

      private

      def index
        @index ||= MarshalStream.new @index_io
      end

      def stream
        @stream ||= MarshalStream.new @data_io
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aggro-0.0.4 lib/aggro/file_store/reader.rb