tessl install tessl/pypi-pylibmc@1.6.0Quick and small memcached client for Python
Agent Success
Agent success rate when using this tile
86%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.04x
Baseline
Agent success rate without this tile
83%
Utility for clearing and refreshing cache entries on a memcached-backed client, emphasizing targeted removal, bulk cleanup, TTL extension, and full flush behavior.
True and subsequent retrieval of that key yields a cache miss. @testFalse without affecting other stored values. @testFalse and does not create data. @test@generates
from typing import Iterable, Mapping
class CacheJanitor:
def __init__(self, client) -> None:
"""client is a configured cache client supporting basic read/write/delete semantics."""
def remove(self, key: str) -> bool:
"""Remove a single key; returns True if the key was present and removed, False otherwise."""
def remove_many(self, keys: Iterable[str]) -> Mapping[str, bool]:
"""Bulk-remove keys; returns a mapping of each provided key to whether it was removed."""
def refresh_ttl(self, key: str, ttl_seconds: int) -> bool:
"""Push back the expiration for a key without altering its value."""
def flush(self) -> None:
"""Clear the entire cache."""Memcached client used for cache operations and TTL control. @satisfied-by