def handle_chunk(type, content)
      case t = CHUNK_TYPES.key(type)
      when :stdout, :stderr
        opts[t].write content
      when :exit
        socket.close
        handle_exit(content.to_i)
      else
        raise UnexpectedChunktypeError.new([type, content].join(?;))
      end
    end
def handle_chunk(type, content)
      case t = CHUNK_TYPES.key(type)
      when :stdout, :stderr
        opts[t].write content
      when :exit
        socket.close
        handle_exit(content.to_i)
      else
        raise UnexpectedChunktypeError.new([type, content].join(?;))
      end
    end
Private: Determine what to do with the received chunk

 type - chunk type
 content - chunk content