Method: GQTP::Backend::Thread::IO#write
- Defined in:
- lib/gqtp/backend/thread.rb
#write(*chunks) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/gqtp/backend/thread.rb', line 40 def write(*chunks) thread = ::Thread.new do chunks.each do |chunk| until chunk.empty? written_bytes = @real_io.write(chunk) break if chunk.bytesize == written_bytes chunk = chunk[written_bytes..-1] end end yield if block_given? end Request.new(thread) end |