# File lib/pr_eventmachine.rb, line 419
419:     def eventable_write
420:       # coalesce the outbound array here, perhaps
421:       while data = @outbound_q.shift do
422:         begin
423:           data = data.to_s
424:           w = if io.respond_to?(:write_nonblock)
425:             io.write_nonblock data
426:           else
427:             io.syswrite data
428:           end
429: 
430:           if w < data.length
431:             $outbound_q.unshift data[w..-1]
432:             break
433:           end
434:         rescue Errno::EAGAIN
435:           @outbound_q.unshift data
436:         rescue EOFError, Errno::ECONNRESET
437:           @close_scheduled = true
438:           @outbound_q.clear
439:         end
440:       end
441: 
442:     end