Returns a Future
asynchronously returning a transformed result.
import java.util.concurrent.* def executor = Executors.newSingleThreadExecutor() Futurefoobar = executor.submit{ "foobar" } Future foobarSize = foobar.collect{ it.size() } assert foobarSize.get() == 6 executor.shutdown()
transform
- the closure used to transform the Future value