Skip to content

Instantly share code, notes, and snippets.

Created March 5, 2023 01:41
What would you like to do?
let imageDatas = try await withThrowingTaskGroup(of: Data.self, returning: [Data].self) { group in
imageIdentifiers.forEach { imageIdentifier in
group.addTask {
return try await ImageProcessor.process(identifier: imageIdentifier)
var results = [Data]()
for try await imageData in group {
return results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment