Skip to content

decorators

Functions:

  • async_cached

    Decorate an async function to cache its result.

  • cached

    Decorate a function to cache its result.

async_cached

async_cached(
    func: AsyncCallable[P, R],
    storage: Storage,
    *,
    barrier: (
        AbstractContextManager
        | AbstractAsyncContextManager
        | None
    ) = None
) -> CoroCallable[P, R]

Decorate an async function to cache its result.

cached

cached(
    func: Callable[P, R],
    *,
    storage: Storage,
    barrier: AbstractContextManager | None = None
) -> Callable[P, R]

Decorate a function to cache its result.