Ejemplo n.º 1
0
    def __init__(self, capacity=100, compact='auto', compact_threshold=200):
        super(LruAlgorithm, self).__init__()

        self.capacity = to_integer(capacity, 100)

        self.compact_mode = compact
        self.compact_threshold = to_integer(compact_threshold, 200)

        self.queue = LruList()
        self.nodes = {}

        self._buffers = {}
        self._release_lock = Lock()
Ejemplo n.º 2
0
    def __init__(self, protocol=0):
        super(PickleSerializer, self).__init__()

        self.protocol = to_integer(protocol)