storr (version 1.2.1)

storr_external: Storr that looks for external resources

Description

storr for fetching external resources. This driver is used where will try to fetch from an external data source if a resource can not be found locally. This works by checking to see if a key is present in the storr (and if so returning it). If it is not found, then the function fetch_hook is run to fetch it.

Usage

storr_external(storage_driver, fetch_hook, default_namespace = "objects")

Arguments

storage_driver

Another storr driver to handle the actual storage.

fetch_hook

A function to run to fetch data when a key is not found in the store. This function must take arguments key and namespace and return an R object. It must throw an error if the external resource cannot be resolved.

default_namespace

Default namespace (see storr)

Details

See the vignette vignette("external") for much more detail. This function is likely most useful for things like caching resources from websites, or computing long-running quantities on demand.