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%
A helper around a memcached client that applies per-write compression thresholds and compression levels while keeping sensible defaults for future operations.
Default thresholds and levels set at construction are used whenever per-call overrides are omitted.
store with an override threshold of 256 bytes, storing a ~100-byte payload and then a ~1KB payload both return True and load returns the original bytes for each; the override only applies to that call. @test@generates
from typing import Any, Mapping, Optional, Sequence
class AdaptiveCache:
def __init__(self, client, default_min_bytes: int = 0, default_level: int = -1) -> None:
...
def store(self, key: str, value: Any, *, min_bytes: Optional[int] = None, level: Optional[int] = None) -> bool:
...
def store_many(self, values: Mapping[str, Any], *, min_bytes: Optional[int] = None, level: Optional[int] = None) -> Sequence[str]:
...
def load(self, key: str, default: Any = None) -> Any:
...Memcached client with built-in compression threshold and level controls.