Add async version of InitialFeedDownloader.download.

This commit is contained in:
Brent Simmons 2024-04-02 21:25:05 -07:00
parent f99e6b425c
commit 69fd496576

View File

@ -12,6 +12,15 @@ import Web
struct InitialFeedDownloader {
static func download(_ url: URL) async -> ParsedFeed? {
await withCheckedContinuation { continuation in
self.download(url) { parsedFeed in
continuation.resume(returning: parsedFeed)
}
}
}
static func download(_ url: URL,_ completion: @escaping (_ parsedFeed: ParsedFeed?) -> Void) {
downloadUsingCache(url) { (data, response, error) in