示例#1
0
    def _evaluate(self, method='evaluate'):
        """Evaluate next pending request if engine not busy. """
        if not self.evaluating and self.queue:
            args, okay, fail = self.evaluating = self.queue.pop()

            body = utilities.xml_encode(args.source, method)

            http_client = tornado.httpclient.AsyncHTTPClient()
            http_request = tornado.httpclient.HTTPRequest(self.url,
                method='POST', body=body, request_timeout=0)

            http_client.fetch(http_request, self._on_evaluate_handler)
    def _evaluate(self, method='evaluate'):
        """Evaluate next pending request if engine not busy. """
        if not self.evaluating and self.queue:
            args, okay, fail = self.evaluating = self.queue.pop()

            body = utilities.xml_encode(args.source, method)
            headers = HTTPHeaders({'Content-Type': 'application/xml'})

            request = HTTPRequest(self.url, method='POST',
                body=body, headers=headers, request_timeout=0)

            client = AsyncHTTPClient()
            client.fetch(request, self._on_evaluate_handler)