Beispiel #1
0
 def set(self, key: str, value: V, ttl: Optional[timedelta] = None) -> None:
     return self.storage.set(
         wrap_key(self.prefix, self.version, key),
         value,
         ttl,
     )
Beispiel #2
0
 def get_many(self, keys: Sequence[str]) -> Iterator[Tuple[str, V]]:
     results = self.storage.get_many(
         [wrap_key(self.prefix, self.version, key) for key in keys])
     for key, value in results:
         yield unwrap_key(self.prefix, self.version, key), value
Beispiel #3
0
 def delete_many(self, keys: Sequence[str]) -> None:
     return self.storage.delete_many(
         [wrap_key(self.prefix, self.version, key) for key in keys])
Beispiel #4
0
 def get(self, key: str) -> Optional[V]:
     return self.storage.get(wrap_key(self.prefix, self.version, key))
Beispiel #5
0
 def delete(self, key: str) -> None:
     self.storage.delete(wrap_key(self.prefix, self.version, key))