Exemplo n.º 1
0
class OfflineRequestsManager(object):

    _logger = logging.getLogger(__name__)

    def __init__(self, max_size, drop_behavior):
        self._queue = OfflineRequestQueue(max_size, drop_behavior)

    def has_more(self):
        return len(self._queue) > 0

    def add_one(self, request):
        return self._queue.append(request)

    def get_next(self):
        if self.has_more():
            return self._queue.pop(0)
        else:
            return None
Exemplo n.º 2
0
class OfflineRequestsManager(object):

    _logger = logging.getLogger(__name__)

    def __init__(self, max_size, drop_behavior):
        self._queue = OfflineRequestQueue(max_size, drop_behavior)

    def has_more(self):
        return len(self._queue) > 0

    def add_one(self, request):
        return self._queue.append(request)

    def get_next(self):
        if self.has_more():
            return self._queue.pop(0)
        else:
            return None
Exemplo n.º 3
0
 def __init__(self, max_size, drop_behavior):
     self._queue = OfflineRequestQueue(max_size, drop_behavior)
Exemplo n.º 4
0
 def __init__(self, max_size, drop_behavior):
     self._queue = OfflineRequestQueue(max_size, drop_behavior)