summaryrefslogtreecommitdiffstats
path: root/reporting/api/extension/client.py
blob: 03371fd440c93210ef5b544c5584a460bbce158d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from tornado.simple_httpclient import SimpleAsyncHTTPClient
from tornado.log import gen_log


class NoQueueTimeoutHTTPClient(SimpleAsyncHTTPClient):
    def fetch_impl(self, request, callback):
        key = object()

        self.queue.append((key, request, callback))
        self.waiting[key] = (request, callback, None)

        self._process_queue()

        if self.queue:
            gen_log.debug("max_clients limit reached, request queued.")