Polls the dataset processing status until it reaches "succeeded", then returns the dataset ID invisibly. Errors if processing fails, expires unexpectedly, or the timeout is reached.
Usage
await_dataset_processing(
dataset,
poll_interval = 0.5,
timeout = 60,
quiet = FALSE,
auth_token = Sys.getenv("SCPCA_AUTH_TOKEN")
)Arguments
- dataset
the dataset UUID string, or a list with an
$idelement, such as the return value ofcreate_dataset().- poll_interval
Number of minutes to wait between status checks when
await_processing = TRUE. Default is 0.5 (30 seconds).- timeout
Maximum number of minutes to wait for processing to complete when
await_processing = TRUE. UseInfto wait indefinitely. Default is 60 (1 hour).- quiet
Whether to suppress download progress messages. Default is FALSE.
- auth_token
an authorization token from
get_auth(). Defaults to theSCPCA_AUTH_TOKENenvironment variable, whichget_auth()sets automatically.
Details
This function only waits — it does not start processing or download data.
To start processing, use start_dataset_processing() first, or call
download_dataset() with await_processing = TRUE to start, wait, and
download in one step.
Examples
if (FALSE) { # \dontrun{
ds <- create_dataset(samples = c("SCPCS000001", "SCPCS000002"))
start_dataset_processing(ds, email = "user@example.com")
await_dataset_processing(ds)
download_dataset(ds)
} # }