Class: Driq::EventStream

Inherits:
Object
  • Object
show all
Defined in:
lib/driq.rb

Instance Method Summary collapse

Constructor Details

#initialize(src, seek = nil) ⇒ EventStream

Returns a new instance of EventStream.



148
149
150
151
# File 'lib/driq.rb', line 148

def initialize(src, seek=nil)
  @src = src
  @cursor = Integer(seek) rescue (src.driq.last_key - 1)
end

Instance Method Details

#closeObject



158
# File 'lib/driq.rb', line 158

def close; end

#popObject



153
154
155
156
# File 'lib/driq.rb', line 153

def pop
  @cursor, buf = @src.read(@cursor)
  buf
end