INNER CODE UNIT · Python

func_res

python-cachier/cachier · src/cachier/core.py:121

        func_res = await func(*args, **kwds)
        await core.aset_entry(key, func_res)
    except BaseException as exc:
        print(f"Function call failed with the following exception:\n{exc}")


def _calc_entry(core: _BaseCore, key, func, args, kwds, printer=lambda *_: None) -> Optional[Any]:
    core.mark_entry_being_calculated(key)
    try:
        func_res = func(*args, **kwds)
        stored = core.set_entry(key, func_res)
        if not stored:
            printer("Result exceeds entry_size_limit; not cached")
        return func_res
    finally:
        core.mark_entry_not_calculated(key)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…