Class: Driq::EventStream
- Inherits:
-
Object
- Object
- Driq::EventStream
- Defined in:
- lib/driq.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(src, seek = nil) ⇒ EventStream
constructor
A new instance of EventStream.
- #pop ⇒ Object
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
#close ⇒ Object
158 |
# File 'lib/driq.rb', line 158 def close; end |
#pop ⇒ Object
153 154 155 156 |
# File 'lib/driq.rb', line 153 def pop @cursor, buf = @src.read(@cursor) buf end |