Skip to content

Commit c09fbba

Browse files
committed
PB-1024: add comment for parallel download
1 parent d805a5b commit c09fbba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

download-data/stac-api/large-assets.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,9 @@ def main():
296296
if __name__ == '__main__':
297297
main()
298298
```
299+
300+
::: tip Parallel Downloads
301+
The script above downloads chunks sequentially, which is simple and reliable. For faster downloads on high-bandwidth connections, you can parallelize by downloading multiple chunks simultaneously using threads or asyncio.
302+
303+
Since each chunk has a specific byte range and the script uses `file_handle.seek(offset)` before writing, chunks can be written to their correct positions in the file regardless of the order they complete. This allows multiple chunks to download in parallel and write to different parts of the file safely.
304+
:::

0 commit comments

Comments
 (0)