Calls one trusted installed export, substituting only declared top-level
output arguments. The writer's return value is discarded. This is not a
sandbox, scheduler, native-process supervisor or complete artifact DAG.
Plain strings are configuration; files must use reflow_imaging_input().
Paths reject symbolic links, special files, reserved Windows components and
trailing dots/spaces. Unicode spelling is preserved, not normalized. Parents
of output paths are created; declared output directories are writer-created.
Installed package resources (including templates), tracked inputs and
declared
external runtime files are fingerprinted. Undeclared ambient state is not.
With options(reflowR.package_hash_cache = TRUE) the hashes of installed
package files are reused within one R process while a file keeps its
device, inode, size, modification and change times; use it only with a
library that nothing modifies during the run.
options(reflowR.input_hash_cache = TRUE) does the same for tracked input
files; otherwise inputs are re-read for every fingerprint.
Arguments
- package, fun
Installed package and exported writer function.
- args
Uniquely named ordinary arguments, excluding output arguments.
- outputs
Named list keyed by output argument, each an exact list with
path(relative to the bundle) andtype(fileordirectory).- inventory
Nonempty named character vector of logical artifact names mapped to exact relative file paths. Unexpected directories also fail.
- allow_empty
Logical artifact names permitted to contain zero bytes.
- seed
Explicit nonnegative integer seed, or NULL for a nonrandom writer.
- packages
Additional installed packages to fingerprint.
- runtime_files
Existing external runtime files to fingerprint. The caller must ensure the writer actually dispatches these binaries/resources.
Examples
spec <- reflow_artifact_spec(
"utils", "write.csv",
args = list(x = data.frame(id = 1:3, value = c(2.5, 3.1, 4.7)),
row.names = FALSE),
outputs = list(file = list(path = "table.csv", type = "file")),
inventory = c(table = "table.csv")
)
spec$outputs
#> $file
#> $file$path
#> [1] "table.csv"
#>
#> $file$type
#> [1] "file"
#>
#>
spec$inventory
#> table
#> "table.csv"