mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-11 01:04:05 +01:00
Add async version of InitialFeedDownloader.download.
This commit is contained in:
parent
f99e6b425c
commit
69fd496576
@ -12,6 +12,15 @@ import Web
|
|||||||
|
|
||||||
struct InitialFeedDownloader {
|
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) {
|
static func download(_ url: URL,_ completion: @escaping (_ parsedFeed: ParsedFeed?) -> Void) {
|
||||||
|
|
||||||
downloadUsingCache(url) { (data, response, error) in
|
downloadUsingCache(url) { (data, response, error) in
|
||||||
|
Loading…
Reference in New Issue
Block a user