Skip to content

xtr_cache.command

The cache:pool:* console commands.

Importing this module declares them. With a container, the cache bundle loads it when the console bundle is active, and every command acts on the pools the bundle registered. Without one, give them pools with :func:use_pools:

from xtr_cache import CachePoolClearer, FilesystemAdapter
from xtr_cache.command import use_pools

use_pools(CachePoolClearer({"app": FilesystemAdapter("app")}))

Needs xtr-console installed beside this package.

CachePoolClearCommand

CachePoolClearCommand(pools: CachePoolClearer = UNSET)

Bases: PoolCommand

Clears cache pools.

CachePoolDeleteCommand

CachePoolDeleteCommand(pools: CachePoolClearer = UNSET)

Bases: PoolCommand

Deletes an item from a cache pool.

CachePoolInvalidateTagsCommand

CachePoolInvalidateTagsCommand(pools: CachePoolClearer = UNSET)

Bases: PoolCommand

Invalidates cache tags, in every tag-aware pool or in the ones named.

CachePoolListCommand

CachePoolListCommand(pools: CachePoolClearer = UNSET)

Bases: PoolCommand

Lists the available cache pools.

CachePoolPruneCommand

CachePoolPruneCommand(pools: CachePoolClearer = UNSET)

Bases: PoolCommand

Prunes cache pools: removes the expired values their backend keeps.

use_pools

use_pools(pools: CachePoolClearer | None) -> None

Have every cache command act on pools wherever no container supplies them.