Exemple #1
0
    def __init__(
        self, serializer=None, plugins=None, namespace=None, key_builder=None, timeout=5, ttl=None
    ):
        self.timeout = timeout
        self.namespace = namespace
        self.ttl = ttl
        self.build_key = key_builder or self._build_key

        self._serializer = None
        self.serializer = serializer or serializers.StringSerializer()

        self._plugins = None
        self.plugins = plugins or []
Exemple #2
0
    def __init__(
        self, serializer=None, plugins=None, namespace=None, key_builder=None, timeout=5, ttl=None
    ):
        self.timeout = float(timeout) if timeout is not None else timeout
        self.namespace = namespace
        self.ttl = float(ttl) if ttl is not None else ttl
        self.build_key = key_builder or self._build_key

        self._serializer = None
        self.serializer = serializer or serializers.StringSerializer()

        self._plugins = None
        self.plugins = plugins or []