Method: GQTP::Connection::Thread::IO#read

Defined in:
lib/gqtp/connection/thread.rb

#read(size = nil) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/gqtp/connection/thread.rb', line 54

def read(size=nil)
  thread = ::Thread.new do
    data = @real_io.read(size)
    if block_given?
      yield(data)
    else
      data
    end
  end
  Request.new(thread)
end