Bug 1897264 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

`SuggestStore.interrupt()` currently only interrupts reads. This is by design, so that consumers can cancel ongoing queries as the user types, and free up the reader connection for their latest input. I'm thinking that `interruptEverything` could interrupt writes as well.

We currently don't have an analogue for interrupting ingestions or writes, which is a problem if we're backgrounded on iOS (or the user closes Firefox, in the case of Desktop), and the OS tells us to wrap up our work. It's still not possible to interrupt network requests with Viaduct, but we can at least check and interrupt the ingestion after the network request completes.

In the worst case of an empty or rechunked database, if we're making 80 network requests for an ingestion, and the OS tells us to stop when we're in the middle of request 5, we can interrupt after request 5 finishes, without having to wait for the remaining 75 requests to finish.

On the iOS side, we can call this API from our background task's ["expiration handler"](https://developer.apple.com/documentation/backgroundtasks/bgtask/expirationhandler). That handler gets called whenever the OS wants to tell us to wrap up our work.

On Desktop, we can call this API at shutdown.
`SuggestStore.interrupt()` currently only interrupts reads. This is by design, so that consumers can cancel ongoing queries as the user types, and free up the reader connection for their latest input. I'm thinking that `interruptEverything` could interrupt writes as well as reads.

(I'm not super tied to the `interruptEverything` name at all; I just wanted to make it something long and vaguely awkward, to gently discourage consumers from using it incorrectly 😅 Unless the browser is shutting down, they shouldn't need to call `interruptEverything`).

We currently don't have an analogue for interrupting ingestions or writes, which is a problem if we're backgrounded on iOS (or the user closes Firefox, in the case of Desktop), and the OS tells us to wrap up our work. It's still not possible to interrupt network requests with Viaduct, but we can at least check and interrupt the ingestion after the network request completes.

In the worst case of an empty or rechunked database, if we're making 80 network requests for an ingestion, and the OS tells us to stop when we're in the middle of request 5, we can interrupt after request 5 finishes, without having to wait for the remaining 75 requests to finish.

On the iOS side, we can call this API from our background task's ["expiration handler"](https://developer.apple.com/documentation/backgroundtasks/bgtask/expirationhandler). That handler gets called whenever the OS wants to tell us to wrap up our work.

On Desktop, we can call this API at shutdown.
`SuggestStore.interrupt()` currently only interrupts reads. This is by design, so that consumers can cancel ongoing queries as the user types, and free up the reader connection for their latest input. I'm thinking that `interruptEverything` could interrupt writes as well as reads.

We currently don't have an analogue for interrupting ingestions or writes, which is a problem if we're backgrounded on iOS (or the user closes Firefox, in the case of Desktop), and the OS tells us to wrap up our work. It's still not possible to interrupt network requests with Viaduct, but we can at least check and interrupt the ingestion after the network request completes.

In the worst case of an empty or rechunked database, if we're making 80 network requests for an ingestion, and the OS tells us to stop when we're in the middle of request 5, we can interrupt after request 5 finishes, without having to wait for the remaining 75 requests to finish.

On the iOS side, we can call this API from our background task's ["expiration handler"](https://developer.apple.com/documentation/backgroundtasks/bgtask/expirationhandler). That handler gets called whenever the OS wants to tell us to wrap up our work.

On Desktop, we can call this API at shutdown.

(I'm not super tied to the `interruptEverything` name at all; I just wanted to make it something long and vaguely awkward, to gently discourage consumers from using it incorrectly 😅 Unless the browser is shutting down, they shouldn't need to call `interruptEverything`).
`SuggestStore.interrupt()` currently only interrupts reads. This is by design, so that apps can cancel ongoing queries as the user types, and free up the reader connection for the user's latest input.

We currently don't have an analogue for interrupting ingestions or writes, which is a problem if we're backgrounded on iOS (or the user closes Firefox, in the case of Desktop), and the OS tells us to wrap up our work. It's still not possible to interrupt network requests with Viaduct, but that's OK; we can still check and interrupt the ingestion after the network request completes.

I'm thinking that `interruptEverything` could be this analogue, and interrupt writes as well as reads.

In the worst case of an empty or rechunked database, if we're making 80 network requests for an ingestion, and the OS tells us to stop when we're in the middle of request 5, we can interrupt ingestion after request 5 finishes, without having to wait for the remaining 75 requests to finish.

On the iOS side, we can call `interruptEverything` from our background ingestion task's ["expiration handler"](https://developer.apple.com/documentation/backgroundtasks/bgtask/expirationhandler). That handler gets called whenever iOS wants to tell us to wrap up.

On Desktop, we can call `interruptEverything` at shutdown.

(I'm not tied to the `interruptEverything` name at all; I just wanted to make it something long and vaguely awkward, to gently discourage consumers from using it incorrectly 😅 Unless the app is shutting down, it shouldn't need to call `interruptEverything`).

Back to Bug 1897264 Comment 0