def ExecuteTask(self, task, queue):
    method = task.RequestMethod_Name(task.method())
    header_dict, headers = self._HeadersFromTask(task, queue)
    connection_host, = header_dict.get('host', [self._default_host])
    if connection_host is None:
      logging.error('Could not determine where to send the task "%s" '
                    '(Url: "%s") in queue "%s". Treating as an error.',
                    task.task_name(), task.url(), queue.queue_name)
      return False
    else:
      header_dict['Host'] = connection_host
    dispatcher = self._request_data.get_dispatcher()
    try:
      response = dispatcher.add_request(method, task.url(), headers,
                                        task.body() if task.has_body() else '',
                                        '0.1.0.2')
    except request_info.ServerDoesNotExistError:
      logging.exception('Failed to dispatch task')
      return 0
    return int(response.status.split(' ', 1)[0])
Construct a http request from the task and dispatch it.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/taskqueue/taskqueue_stub.py/_TaskExecutor.ExecuteTask