def test() {
def map = new PromiseMap()
map['one'] = { 2 * 2 }
map['two'] = { 4 * 4 }
map['three'] = { 8 * 8 }
map.onComplete { Map results ->
render results as JSON
}
}
{"one":4,"two":16,"three":64}
{"one":16,"two":64,"three":4}