wfexs_backend.utils.pyld_caching#

Module Contents#

Functions#

aiohttp_caching_document_loader

This code is based on aiohttp_document_loader from https://raw.githubusercontent.com/digitalbazaar/pyld/2c6b0a65bee700b42c8d0806364f4fc4ebddcc52/lib/pyld/documentloader/aiohttp.py

hook_pyld_cache

pyld_cache_initialize

This method hooks the caching system to pyld, so context resolution does not need to connect to internet. And, if the list of initial contexts is not empty, populate the cache with them.

API#

wfexs_backend.utils.pyld_caching.aiohttp_caching_document_loader(cache_file: str, loop: asyncio.AbstractEventLoop | None = None, secure: bool = False, **kwargs: Any) Callable[[str, Mapping[str, Mapping[str, str]]], Mapping[str, Any]]#

This code is based on aiohttp_document_loader from https://raw.githubusercontent.com/digitalbazaar/pyld/2c6b0a65bee700b42c8d0806364f4fc4ebddcc52/lib/pyld/documentloader/aiohttp.py

wfexs_backend.utils.pyld_caching.hook_pyld_cache(cache_file: str) None#
wfexs_backend.utils.pyld_caching.pyld_cache_initialize(initial_contexts: Sequence[str] = []) None#

This method hooks the caching system to pyld, so context resolution does not need to connect to internet. And, if the list of initial contexts is not empty, populate the cache with them.