Created
February 3, 2022 12:22
-
-
Save SebastianBoldt/8e807e8a55ae0c0417d0f1993c9fb294 to your computer and use it in GitHub Desktop.
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
let url = URL(string:"https://www.sebastianboldt.com") | |
let pollingSequence = URLPollingSequence(url: url!, delay: 2) | |
do { | |
for try await item in pollingSequence { | |
guard let data = item else { | |
continue | |
} | |
print(String(data: data, encoding: String.Encoding.utf8) ?? "Not decodable") | |
} | |
} catch { | |
print(error.localizedDescription) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment