def wsgi_write(self, start_response):
    body = self.out.getvalue()
    if isinstance(body, unicode):
      body = body.encode('utf-8')
    elif self.headers.get('Content-Type', '').endswith('; charset=utf-8'):
      try:
        body.decode('utf-8')
      except UnicodeError, e:
        logging.warning('Response written is not UTF-8: %s', e)

    if (self.headers.get('Cache-Control') == 'no-cache' and
        not self.headers.get('Expires')):
      self.headers['Expires'] = 'Fri, 01 Jan 1990 00:00:00 GMT'
    self.headers['Content-Length'] = str(len(body))
    write = start_response('%d %s' % self.__status, self.__wsgi_headers)
    write(body)
    self.out.close()
Stop the queue-consumer gracefully.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/webapp/__init__.py/Response.wsgi_write--crossover with--dataset/ETHPy150Open onefinestay/nameko/nameko/messaging.py/QueueConsumer.stop