Tutorial by Examples

Spread dot operator can be used instead of collect method (1..10)*.multiply(2) // equivalent to (1..10).collect{ it *2 } d = ["hello", "world"] d*.size() // d.collect{ it.size() }
Gpars offers intuitive ways to handle tasks concurrently import groovyx.gpars.* GParsPool.withPool { def result = dataList.collectParallel { processItem(it) } }

Page 1 of 1