Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created February 20, 2022 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/f1d9cbb7803bc6ca56156739ccf5be16 to your computer and use it in GitHub Desktop.
Save laevandus/f1d9cbb7803bc6ca56156739ccf5be16 to your computer and use it in GitHub Desktop.
func preloadMessages(for conversations: [Conversation]) async {
await withThrowingTaskGroup(of: Void.self) { taskGroup in
for conversation in conversations {
taskGroup.addTask {
try await self.preloadMessages(for: conversation)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment