Answer the question
In order to leave comments, you need to log in
What's wrong with promises in Grails 3?
Hey!
Here is a simple example from the official documentation:
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}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question