core.db.cache

Attributes

MEMCACHE_MAX_BATCH_SIZE

MEMCACHE_NAMESPACE

MEMCACHE_TIMEOUT

MEMCACHE_MAX_SIZE

Functions

get(keys[, namespace])

Reads data form the memcache.

put(data[, namespace, timeout])

Writes Data to the memcache.

delete(keys[, namespace])

Deletes an Entry form memcache.

flush()

Deletes everything in memcache.

Module Contents

core.db.cache.MEMCACHE_MAX_BATCH_SIZE = 30
core.db.cache.MEMCACHE_NAMESPACE = 'viur-datastore'
core.db.cache.MEMCACHE_TIMEOUT: int | datetime.timedelta
core.db.cache.MEMCACHE_MAX_SIZE: Final[int] = 1000000
core.db.cache.get(keys, namespace=None)

Reads data form the memcache. :param keys: Unique identifier(s) for one or more entry(s). :param namespace: Optional namespace to use. :return: The entity (or None if it has not been found), or a list of entities.

Parameters:
Return type:

Union[core.db.types.Entity, list[core.db.types.Entity], None]

core.db.cache.put(data, namespace=None, timeout=None)

Writes Data to the memcache. :param data: Data to write :param namespace: Optional namespace to use. :param timeout: Optional timeout in seconds or a timedelta object. :return: A boolean indicating success.

Parameters:
Return type:

bool

core.db.cache.delete(keys, namespace=None)

Deletes an Entry form memcache. :param keys: Unique identifier(s) for one or more entry(s). :param namespace: Optional namespace to use.

Parameters:
Return type:

None

core.db.cache.flush()

Deletes everything in memcache. :return: A boolean indicating success.

Return type:

bool