forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prefetcher: proxy wait channel requests while paused
If the prefetcher is paused because it's on a cellular network, or the app has been backgrounded, we shouldn't block the "wait channel" requests indefinitely. These are processed on the same queue as regular prefetch requests, and so can't be processed until we're unpaused. But the caller is just asking for a channel they can wait on; they don't actually expect this call itself to block. So if the prefetcher is paused, return a proxy channel that the caller can use, and launch a goroutine that will close this channel when the request is eventually processed. I considered _always_ returning a proxy channel, but it seemed nice to still wait on `ctx.Done()` and the shutdown channel in the case where we expect the request to be processed quickly. Issue: HOTPOT-2569
- Loading branch information
Showing
2 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters