Returned by `M2MDownloadOptions$request()`, or reconnected to with `M2MSession$download_queue(label)`. Tracks which files are ready to download and which the distribution system is still preparing.
Methods
M2MDownloadQueue$new()
Attach to a download order. Use `M2MDownloadOptions$request()` or `M2MSession$download_queue()`.
Usage
M2MDownloadQueue$new(session, label, available = NULL, n_preparing = NULL)M2MDownloadQueue$refresh()
Re-poll the M2M queue for this label, picking up files that have finished preparing since the last check.
Unlike the other methods here, this updates the object in place rather than returning a new one, because it reflects changing server-side queue state.
M2MDownloadQueue$ready()
The files that can be downloaded now. Readiness is based on having a URL, regardless of which internal API bucket supplied it.
M2MDownloadQueue$retrieve()
Download every file that has a URL to disk. Call `$refresh()` first if `$is_ready()` is `FALSE`.
Files are named as the server names them - the `.tar` of a product bundle, the `.TIF` of a band - rather than after the `entityId` the queue lists them under, which for a scene-level product is the scene id and carries no extension.
A file already in `out_dir` under that name is left alone unless `overwrite` is `TRUE`, so re-running this after an interrupted order only fetches what is missing. Since the name usually only becomes known once the server has answered, the request is still made for each file, but none of the body is transferred for one that is already there.
Proxied downloads are reported back to the API afterwards, since it does not serve them itself and would otherwise leave them in the queue indefinitely. Files skipped as already present are reported too - they are on disk, so the order is fulfilled.
M2MDownloadQueue$summary()
Summarize this order by dataset, via the `download-summary` endpoint.
M2MDownloadQueue$prepare()
Move this order's scenes into the queue for processing, via the `download-order-load` endpoint.
Unlike the other methods here this changes server-side state: it is what starts a staged order being prepared. Follow it with `$refresh()` to pick up URLs as they become ready.
M2MDownloadQueue$remove_items()
Remove individual files from this order, leaving the rest of it in place. `$cancel()` drops the whole order instead.
Ids come from the `downloadId` column of `$ready()` or `$pending()`.