Beispiel #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
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
Beispiel #3
0
 def __init__(self, max_size, drop_behavior):
     self._queue = OfflineRequestQueue(max_size, drop_behavior)
 def __init__(self, max_size, drop_behavior):
     self._queue = OfflineRequestQueue(max_size, drop_behavior)