Class: DiscardReader
- Inherits:
-
Object
- Object
- DiscardReader
- Defined in:
- lib/datalackeylib.rb
Instance Method Summary collapse
- #close ⇒ Object
- #getlines ⇒ Object
-
#initialize(input) ⇒ DiscardReader
constructor
A new instance of DiscardReader.
Constructor Details
#initialize(input) ⇒ DiscardReader
Returns a new instance of DiscardReader.
615 616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/datalackeylib.rb', line 615 def initialize(input) @input = input return if input.nil? @reader = Thread.new do loop do @input.readpartial(32768) rescue IOError break # It is possible that close happens in another thread. rescue EOFError break end end end |
Instance Method Details
#close ⇒ Object
629 630 631 632 633 |
# File 'lib/datalackeylib.rb', line 629 def close return if @input.nil? @input.close @reader.join end |
#getlines ⇒ Object
635 636 637 |
# File 'lib/datalackeylib.rb', line 635 def getlines [] end |