% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/showCacheEtc.R
\name{prepopulateCacheAsync}
\alias{prepopulateCacheAsync}
\title{Pre-populate the in-memory \code{showCache} cache for a given \code{cachePath}}
\usage{
prepopulateCacheAsync(cachePath = getOption("reproducible.cachePath"))
}
\arguments{
\item{cachePath}{A character path. Defaults to
\code{getOption("reproducible.cachePath")}.}
}
\value{
Invisibly returns the spawn job handle, or \code{NULL} if the spawn
was skipped.
}
\description{
Forks a background process that runs \code{showCache()} against \code{cachePath};
subsequent \code{showCache()} / \code{Cache()->showSimilar()} calls in the same R
session can then harvest the result instead of re-scanning the cache
directory synchronously. Useful for very large caches (tens of thousands
of entries) where the cold first scan can take a minute or more.
}
\details{
Idempotent: a second call with the same \code{cachePath} reuses the existing
job. Skipped silently on Windows (forking-based) and when the \code{parallel}
package isn't available.

This helper is called automatically the first time \code{Cache()} or
\code{showCache()} is invoked against a given \code{cachePath}, so most users do
not need to call it explicitly. It is exported for workflows that want
to kick off the spawn early (e.g. inside \code{setupProject()}) so the fork
has more wall-clock time to complete before the first manual
\code{showCache()} call.
}
