Quick and small memcached client for Python
86
A helper that relies on memcached's conditional write and string concatenation primitives to manage text entries without race-prone read-modify-write cycles.
True; calling it again leaves the existing value untouched and returns False. @testTrue; attempting on a missing key returns False without creating the entry. @test"second" to an existing entry "first" results in "first\nsecond" through a direct concatenation primitive rather than fetching and rewriting the value. @test"[HDR]" to an existing entry "body" results in "[HDR]body" while leaving the remainder intact. @test@generates
from typing import Any
class CacheJournal:
def __init__(self, client: Any, default_ttl: int | None = None):
...
def initialize(self, key: str, seed: str, ttl: int | None = None) -> bool:
...
def overwrite_existing(self, key: str, text: str, ttl: int | None = None) -> bool:
...
def append_entry(self, key: str, text: str) -> bool:
...
def prepend_banner(self, key: str, banner: str) -> bool:
...Memcached client providing conditional writes and in-place string concatenation.
Install with Tessl CLI
npx tessl i tessl/pypi-pylibmcevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10