seanoc5
09/15/2023, 12:39 PM@CompileDynamic
Promise<List<String>> fetchPomised(List<Document> documentList) {
<http://log.info|log.info> "Fetch with promises (${documentList.size()}) docs..."
PromiseList<String> list = new PromiseList<String>()
documentList.each {Document doc ->
<http://log.info|log.info> "fetch doc: $doc"
list << task {
fetch(doc)
}
}
<http://log.info|log.info> "return from promise land..."
return list
}
note: I missed the instruction to import static grails.async.Promises.*, I expect that is just me, but leaving it as a note here in case there are others like me who leap into code before RTFM...