Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pylibmc@1.6.x
tile.json

tessl/pypi-pylibmc

tessl install tessl/pypi-pylibmc@1.6.0

Quick 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%

task.mdevals/scenario-7/

Cache Janitor

Utility for clearing and refreshing cache entries on a memcached-backed client, emphasizing targeted removal, bulk cleanup, TTL extension, and full flush behavior.

Capabilities

Delete single entry

  • Removing an existing key returns True and subsequent retrieval of that key yields a cache miss. @test
  • Removing a missing key returns False without affecting other stored values. @test

Delete multiple entries at once

  • Deleting a mix of existing and missing keys returns a mapping of every requested key to whether it was removed, and only existing keys disappear from the cache. @test

Refresh TTL for hot items

  • Refreshing the expiration for a present key extends its life while preserving the stored value; doing the same for a missing key returns False and does not create data. @test

Flush all cached data

  • Flushing the cache clears every key across configured servers so that previously stored values read back as misses until rewritten. @test

Implementation

@generates

API

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."""

Dependencies { .dependencies }

pylibmc { .dependency }

Memcached client used for cache operations and TTL control. @satisfied-by