> For the complete documentation index, see [llms.txt](https://fmtc.jaffaketchup.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fmtc.jaffaketchup.dev/v9/bulk-downloading/control.md).

# Control Downloads

There are 3 methods available to control a download, and 1 method to check the download's current state.

{% embed url="<https://pub.dev/documentation/flutter_map_tile_caching/latest/flutter_map_tile_caching/StoreDownload-class.html>" %}

{% hint style="info" %}
It may take some time to perform these operations if the download has a low TPS, as each thread checks the current state/awaits a signal between each of their tiles.

`pause` & `cancel` are asynchronous for this reason, and will complete when all threads are paused or cancelled. `resume` returns immediately.
{% endhint %}

## Pause/Resume

If your user needs to temporarily pause the download, with the ability to resume it at some point later (within the same app session), use `pause` and `resume`.

`pause` allows all threads to finish the tile they're currently downloading, then forces them to wait for a signal sent by `resume` before they can download their next tile. It does not write any buffered tiles to the store.

Use `isPaused` to check whether the download is currently paused.

## Cancel

If your user needs to stop the download entirely, use `cancel`.

`cancel` allows all threads to finish the tile they're currently downloading, then forces them to cleanup and 'kill' themselves. Any buffered tiles are written to the store before the future returned by `cancel` is completed.

It is safe to use `cancel` after `pause` without `resume`ing first.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fmtc.jaffaketchup.dev/v9/bulk-downloading/control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
